시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB118312631.325%

문제

Svalur Handsome has finally graduated with a degree in computer science, and it couldn't have happened sooner. He has some rather unwise spending habits which he hopes will be more sustainable now that he can get a high paying job as a programmer. He has applied to a few places, and now has a contract in his hands that he could sign and start working almost immediately. But before he takes the offer he wants to figure out how long it could support his spending habits.

At the start of every day Svalur spends half of his remaining money, rounded up. The new job would pay $s$ ISK at the end of every $d$-th day, starting with the $d$-th day. He currently has $m$ ISK to spend as well.

입력

The input has three lines, each containing the positive integers $s, d, m$ respectively. They satisfy $1 \leq s, d, m \leq 2^{1000}$. As these payment details are for a computer science job the numbers are all given in binary, naturally.

출력

Print the number of the day that Svalur wants to spend money, but has none. This should naturally also be printed in binary. If he can support his spending habits indefinitely instead print Infinite money!.

예제 입력 1

101110101
1010
10001110101010101

예제 출력 1

10011

예제 입력 2

101110101
1000
100011101

예제 출력 2

Infinite money!

예제 입력 3

101110101
1010
100011101

예제 출력 3

1001

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2024 I번

  • 문제를 만든 사람: Arnar Bjarni Arnarson