-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestScore.java
More file actions
67 lines (49 loc) · 1.07 KB
/
TestScore.java
File metadata and controls
67 lines (49 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Test Score
In a test, there are N problems, each carrying X marks.
In each problem, Chef either received X marks or 0 marks.
Determine whether it is possible for Chef to achieve exactly Y marks.
Input Format:
The first line contains a single integer T, the number of test cases.
Each test case consists of three integers N, X, and Y.
Output Format:
For each test case, output YES if Chef can achieve exactly Y marks, NO otherwise.
Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 10
1 ≤ X ≤ 10
0 ≤ Y ≤ N⋅X
Sample Input:
5
1 8 4
3 6 12
4 5 0
10 10 100
8 5 36
Sample Output:
NO
YES
YES
YES
NO
*/
import java.util.Scanner;
public class TestScore {
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
for (int i=0;i<n ;i++ ){
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if(c%b==0 && a*b >= c){
System.out.println("YES");
}
else{
System.out.println("NO");
}
}
}
}