시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 181 43 38 25.000%

문제

상근이는 선영이에게 B달러를 빌렸다.

이제 돈을 갚을 시간이다. 매월 초에 상근이가 내야하는 금액의 R 퍼센트가 이자로 붙는다. 상근이는 매월 말에 과외비 M달러를 받고, 이 금액 만큼 선영이에게 갚을 수 있다.

상근이는 선영이에게 더 이상 돈을 빌리지 않고, 상근이는 과외 이외의 일을 하지 않으며, 과외비는 인상되지 않는다.

이러한 경우에 상근이가 돈을 다 갚는데 몇 달이 걸리는지 구하는 프로그램을 작성하시오.

이자는 가까운 센트로 반올림한다. 100센트는 1달러이고, 0.5센트보다 크거나 같은 경우에 1센트로 올림, 나머지 경우에 버림한다.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 첫째 줄에는 테스트 케이스의 수가 주어지며, 1000을 넘지 않는다.

각 테스트 케이스는 한 줄로 이루어져 있고, R, B, M이 주어진다. 세 숫자는 모두 실수로 소수점 둘째 자리까지 주어지며, R ≤ 50.00, B, M ≤ 50000.00을 만족한다.

출력

각 테스트 케이스 마다, 돈을 다 갚는데 몇 달이 걸리는지를 출력한다. 만약, 1200달이 넘어도 돈을 갚을 수 없다면, impossible을 출력한다.

예제 입력 1

11
2.00 100.00 105.00
2.00 100.00 102.00
2.00 100.00 100.00
2.00 100.00 4.00
2.00 100.00 3.00
2.00 100.00 1.00
2.00 100.00 2.00
9.56 5462.50 522.22
12.50 29876.44 33610.99
5.50 1.00 1.05
14.78 40181.09 46119.86

예제 출력 1

1
1
2
36
56
impossible
impossible
impossible
2
2
1
W3sicHJvYmxlbV9pZCI6IjkzMzMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIzYzggXHVhYzFhXHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVjMTIwXHVjNjAxXHVjNzc0XHVjNWQwXHVhYzhjIEJcdWIyZWNcdWI3ZWNc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