/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 166 点
問題文
高橋君は庭に花壇を作ることにしました。花壇は横に細長い形をしており、そこに N 本の花を一列に植える予定です。
花壇の横幅は W センチメートルで、左端を位置 0 cm、右端を位置 W cm とします。花はそれぞれ大きさを無視できるものとし、1 番目の花を左端(位置 0 cm)に、N 番目の花を右端(位置 W cm)に植えます。N 本の花は、隣り合う花同士の間隔がすべて等しくなるように等間隔に配置します。すなわち、i 番目 (1 \leq i \leq N) の花は位置 \frac{(i-1) \times W}{N-1} cm に植えられ、隣り合う花の間隔はいずれも \frac{W}{N-1} センチメートルとなります。
花が健康に育つためには、隣り合う花同士の間隔を十分に確保する必要があります。具体的には、隣り合う花の間隔が K センチメートル以上でなければなりません。
高橋君は、上記の等間隔配置でこの条件を満たせるかどうかを確認したいです。条件を満たせる場合は Yes を、満たせない場合は No を出力してください。
制約
- 2 \leq N \leq 100
- 1 \leq W \leq 1000
- 1 \leq K \leq 1000
- 入力はすべて整数
入力
N W K
1 行目には、花の本数を表す整数 N、花壇の横幅(センチメートル)を表す整数 W、必要な最小間隔(センチメートル)を表す整数 K が、スペース区切りで与えられる。
出力
等間隔に配置したときに隣り合う花の間隔が K センチメートル以上である場合は Yes を、そうでない場合は No を 1 行で出力せよ。
入力例 1
5 100 20
出力例 1
Yes
入力例 2
10 180 25
出力例 2
No
入力例 3
51 500 15
出力例 3
No
Score : 166 pts
Problem Statement
Takahashi has decided to make a flower bed in his garden. The flower bed is long and narrow, and he plans to plant N flowers in a row.
The width of the flower bed is W centimeters, with the left end at position 0 cm and the right end at position W cm. Each flower can be considered as a point (its size is negligible). The 1st flower is planted at the left end (position 0 cm), and the Nth flower is planted at the right end (position W cm). The N flowers are placed at equal intervals so that the spacing between all adjacent flowers is the same. Specifically, the ith flower (1 \leq i \leq N) is planted at position \frac{(i-1) \times W}{N-1} cm, and the spacing between any two adjacent flowers is \frac{W}{N-1} centimeters.
For the flowers to grow healthily, the spacing between adjacent flowers must be sufficiently large. Specifically, the spacing between adjacent flowers must be at least K centimeters.
Takahashi wants to check whether this equal-interval arrangement satisfies the condition. If the condition is satisfied, output Yes; otherwise, output No.
Constraints
- 2 \leq N \leq 100
- 1 \leq W \leq 1000
- 1 \leq K \leq 1000
- All inputs are integers
Input
N W K
The first line contains three space-separated integers: N representing the number of flowers, W representing the width of the flower bed (in centimeters), and K representing the required minimum spacing (in centimeters).
Output
If the spacing between adjacent flowers in the equal-interval arrangement is at least K centimeters, output Yes; otherwise, output No on a single line.
Sample Input 1
5 100 20
Sample Output 1
Yes
Sample Input 2
10 180 25
Sample Output 2
No
Sample Input 3
51 500 15
Sample Output 3
No