/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
正整数 X,Y,Z が与えられます。
高橋君と青木君は現在それぞれ X 歳、Y 歳です。
高橋君と青木君は毎年 1 月 1 日を迎えると同時に 1 歳ずつ歳を取ります。
(今年も含めて)これから高橋君の年齢が青木君の年齢のちょうど Z 倍となるタイミングが存在するか判定してください。
制約
- 1\le X,Y \le 100
- 2\le Z\le 10
- 入力される値は全て整数
入力
入力は以下の形式で標準入力から与えられる。
X Y Z
出力
高橋君の年齢が青木君の年齢のちょうど Z 倍となるタイミングが存在するならば Yes を、存在しないならば No を出力せよ。
入力例 1
44 20 2
出力例 1
Yes
今から 4 年後に高橋君は 48 歳、青木君は 24 歳になり、高橋君の年齢は青木君の年齢のちょうど 2 倍になります。したがって、 Yes を出力してください。
入力例 2
28 10 3
出力例 2
No
これから高橋君の年齢が青木君の年齢のちょうど 3 倍となるタイミングは存在しません。したがって、No を出力してください。
入力例 3
50 5 10
出力例 3
Yes
現在の高橋君の年齢は青木君の年齢のちょうど 10 倍です。
今年も含めてこれから高橋君の年齢が青木君の年齢のちょうど Z 倍となるタイミングが存在するか判定することに注意してください。
入力例 4
1 100 2
出力例 4
No
Score : 100 points
Problem Statement
You are given positive integers X,Y,Z.
Takahashi and Aoki are currently X years old and Y years old, respectively.
Takahashi and Aoki age by 1 year simultaneously on every January 1st.
Determine whether there is a moment in the future (including this year) when Takahashi's age becomes exactly Z times Aoki's age.
Constraints
- 1\le X,Y \le 100
- 2\le Z\le 10
- All input values are integers.
Input
The input is given from Standard Input in the following format:
X Y Z
Output
Output Yes if there is a moment in the future when Takahashi's age becomes exactly Z times Aoki's age, and No otherwise.
Sample Input 1
44 20 2
Sample Output 1
Yes
Four years from now, Takahashi will be 48 years old and Aoki will be 24 years old, so Takahashi's age will be exactly twice Aoki's age. Thus, output Yes.
Sample Input 2
28 10 3
Sample Output 2
No
There will never be a moment when Takahashi's age becomes exactly three times Aoki's age. Thus, output No.
Sample Input 3
50 5 10
Sample Output 3
Yes
Currently, Takahashi's age is exactly 10 times Aoki's age.
Note that you need to determine whether there will be such a moment in the future including this year.
Sample Input 4
1 100 2
Sample Output 4
No