We fixed the statement, please reread it!!
We fixed the statement, please reread it!!
A scientist wants to do a study on students to see how they would choose candy from a set. He has $n$ students and candies. The candies are sorted by deliciousness increasingly. The candies from $1$ till $k$ have deliciousness of $1$ the candies from $k + 1$ till $2*k$ have deliciousness of $2$, the candies from $2*k + 1$ till $3*k$ have deliciousness of $3$,..... the candies from $x*k$ till $n$ have deliciousness of $x$, the last group can have a size less than $k$.
Students will pick the candy with the highest deliciousness, if multiple candies have the same value then the student can pick any. Starting with the student numbered $1$, take turns choosing candy, the ith student can choose candy from the candies that lie in the range $[max(1, i - e), min(n, i + e)]$ each candy can be picked by at most one student.
The scientist needs to know if there exists a way such that each student takes exactly one candy.
The input is made up of 3 integers on a single line $n,e,k(1 \le n,k \le10^9,0 \le e \le 10^9)$, the number of student and candies, the value that defines the range the student can see, and the size of a single group of candies, respectively.
Output "Yes"(without quotes) if there exists a way, otherwise output "No"(without quotes).
$1^{st}$ test case:
The first student has to pick the last candy.
The second student can pick either the first or the second.
The third can pick whatever is left since he can see the whole array.
$2^{nd}$ test case:
The first student has to pick the second candy.
The second student has to pick the first candy.
Input | Output |
---|---|
3 2 2 Copy
|
Yes Copy
|
2 1 2 Copy
|
Yes Copy
|