Possible scores

In a test, there are N problems, each carrying X marks.
In each problem, you either received X marks or 0 marks.

Determine whether is it possible for you to achieve exactly Y marks.
        
       Input:-5
1 8 4
3 6 12
4 5 0
10 10 100
8 5 36
       Input Description: The first line of input will contain A single integer T, denoting The number of test cases.
-each test case consists of three integers N,X, and Y, The number of problems, The maximum score For each problem, and The score You want. 
       Output: NO
YES
YES
YES
NO
       Output Description: For each test case, output YES if You can achieve exactly Y marks, NO otherwise.
-You can print each character of The string in uppercase or lowercase. For example, The strings YES, YES, YES, and YES, are all considered identical. 
       Constraints: 1<=T<=100
1<=N<=10
1<=X<=10
0<=Y<=N?X
       Explanation: Test case 1: There is no way for you to score exactly 4 marks.

Test case 2: you can score 12 marks by receiving 6 marks in 2 problems and 0 marks in 1 problem.

Test case 3: you can score 0 marks by receiving 0 marks in each of the 4 problems.

Test case 4: you can score 100 marks by receiving 10 marks in each of the 10 problems.

Test case 5: There is no way for you to score exactly 36 marks.

Loading...