시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 256 MB | 35 | 13 | 10 | 31.250% |
A HAIKU is a string that consists of at most 50 lowercase English letters. For a HAIKU $s$, you can compute the hash $h$ as follows:
h = 0 for i=0,...|s|-1 h = (h * a + (s[i] - 'a' + 1)) % b
You are given two integers $a$ and $b$. Construct 100 distinct HAIKUs that have the same hash.
You are given two space-separated integers $a$ and $b$ ($b \le 10^9$, $26 \le a < b$).
Print 100 HAIKUs with the same hash, one per line.
26 52
aaz baz caz daz ... zaz aaaz abaz ... cuaz cvaz
Several HAIKUs are omitted in the printed version of statements; the full version is published in the contest system.
Camp > Petrozavodsk Programming Camp > Winter 2017 > Day 3: Japanese Contest, Head of Republic of Karelia Cup, Round I G번