PivotOJ

Infinite Cash

시간 제한: 1000ms메모리 제한: 1024MB출처: NCPC 2024BOJ 32557

문제

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 ss ISK at the end of every dd-th day, starting with the dd-th day. He currently has mm ISK to spend as well.

입력

The input has three lines, each containing the positive integers s,d,ms, d, m respectively. They satisfy 1s,d,m210001 \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
출력
10011

예제 2

입력
101110101
1000
100011101
출력
Infinite money!

예제 3

입력
101110101
1010
100011101
출력
1001
코드를 제출하려면 로그인하세요.