#K96152. Stone Distribution Among Boxes
Stone Distribution Among Boxes
Stone Distribution Among Boxes
You are given a number of boxes and a number of stones. Initially, each box may be empty, and you want to distribute the stones so that each box contains at least one stone. In one operation, you can add one stone to any box. Given three integers \(n\), \(m\), and \(k\), representing the number of boxes, the total number of stones available, and the number of operations you are allowed to perform, determine if it is possible to distribute the stones so that every box contains at least one stone after exactly \(k\) operations.
The necessary condition for a valid distribution is that there must be at least \(n\) stones available (i.e. \(m \geq n\)) and that the number of operations, \(k\), must be at least the number of extra stones required, i.e., \(k \geq m - n\). Output "YES" if the distribution is possible, otherwise output "NO".
inputFormat
The first line contains an integer \(T\) denoting the number of test cases. Each test case is described by a single line containing three space-separated integers \(n\), \(m\), and \(k\).
\(n\): Number of boxes.
\(m\): Total number of stones available.
\(k\): Number of operations allowed.
outputFormat
For each test case, output a single line containing either "YES" if it is possible to ensure every box gets at least one stone after exactly \(k\) operations, or "NO" otherwise.
## sample4
3 5 3
4 8 5
2 3 1
5 10 0
YES
YES
YES
NO
</p>