| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 69 | 57 | 52 | 81.250% |
The battle of Nieuwpoort occurred in the year 1600ドル$. This is famously easy to remember, because it ends in two zeros. Alas, not all historical events have been so obliging!
You suspect that the problem is with the fixation of historians on the decimal system. Maybe, given the year of another battle, there exists a small base (at most 16ドル$) in which this year would also be easy to remember?
The input consists of:
A-Z and a-z).If it is possible to rewrite the year to make it easier to remember, output this base $b$ (2ドル\leq b\leq 16,ドル in base-10ドル$) and the year written in base-$b$. Otherwise, output "impossible".
The year in base-$b$ must end with "00" and must not start with '0'.
Use letters 'a', 'b', 'c', etc. for the digits following '9' in bases higher than 10ドル$.
If there are multiple valid solutions, you may output any one of them.
1600 Battle of Nieuwpoort
10 1600
625 Battle of Sarus
5 10000
1600 Battle of Sekigahara
8 3100
1815 Battle of Waterloo
11 1400
1859 Battle of Solferino
13 b00
1848 Battle of Bov
2 11100111000
1453 Fall of Constantinople
impossible
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries B번