| A+B |
| Time Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KB |
| Total submit users: 19, Accepted users: 4 |
| Problem 12899 : No special judgement |
| Problem description |
|
There is a computer, which has two memory cells (let us denote these cells by the letters a and b). Each cell (variable) stores some integer at any time. The computer can execute only two instructions a+=b and b+=a. The first instruction increases the value of the variable a by the value stored in the variable b. The second one, respectively, increases the value of b by the value a. A program for this computer consists of a sequence (possible empty) of such instructions. The instructions are executed in the appropriate order. Your task is to determine whether the given value S can be obtained in some cell after executing some program. |
| Input |
|
The input file contains three integers: the initial value of the variable a, the initial value of the variable b and the required value S (0 ≤ a, b, S ≤ 10^18). |
| Output |
|
Output YES if the required value can be obtained as a result of some program execution, or NO otherwise. |
| Sample Input |
1 2 3 3 4 5 3 4 17 |
| Sample Output |
YES NO YES
|
A+B
最新推荐文章于 2024-12-28 11:21:49 发布

448

被折叠的 条评论
为什么被折叠?



