| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 5 초 (추가 시간 없음) | 1024 MB | 380 | 261 | 237 | 70.118% |
Dr. O has two granddaughters (named Alyssa and Konari) and they keep Dr. O young!
When people ask Dr. O how old he is, rather than giving one positive integer (his age), Dr. O provides two positive integers a and k; Dr. O’s age can then be computed using the expression (a × Alyssa’s age) + (k × Konari’s age).
Given three positive integers (Dr. O’s age, Alyssa’s age, and Konari’s age), determine if the positive integers a and k exist.
There is only one input line; it provides (respectively) Dr. O’s age, Alyssa’s age, and Konari’s age. Assume that 1 ≤ Konari’s age < Alyssa’s age < Dr. O’s age ≤ 150.
Print 1 (one) if a and k exist, 0 (zero) otherwise. Note that a and k must both be greater than zero.
69 9 1
1
76 11 7
1
50 9 3
0
70 10 5
1
10 7 2
0