#K7796. Laser Energy Depletion
Laser Energy Depletion
Laser Energy Depletion
Perry the Platypus is on a mission to neutralize a dangerous laser by completely depleting its energy. The laser has an initial energy L, and in each operation Perry can subtract a sequence of decreasing energy amounts starting from a maximum value D down to 1. However, the sequence can only be applied with a limited number of resets, given by N. Each reset allows Perry to repeat the full sequence once more. In total, Perry can perform the sequence (N+1) times.
The sum of the energy deduction in one full sequence is given by the formula:
[ S = \frac{D(D+1)}{2} ]
Thus, the maximum total energy that can be depleted is:
[ T = (N+1) \times \frac{D(D+1)}{2} ]
Your task is to determine whether Perry can completely deplete the laser's energy (i.e. achieve T \geq L).
inputFormat
The first line contains an integer T, the number of test cases. Each of the following T lines contains three space-separated integers: L (the initial energy of the laser), D (the maximum decrement in one operation), and N (the number of allowed resets).
outputFormat
For each test case, output a single line with "YES" if Perry can deplete the laser's energy to zero, or "NO" otherwise.## sample
2
15 5 1
10 3 0
YES
NO
</p>