Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
In a test, there are N problems, each carrying X marks.
In each problem, Chef either received X marks or 0 marks.
Determine whether is it possible for Chef to achieve exactly Y marks.
For each test case, output YES
if Chef can achieve exactly Y marks, NO
otherwise.
You can print each character of the string in uppercase or lowercase. For example, the strings , yes
, and yEs
, are all considered identical.
Input:
5
1 8 4
3 6 12
4 5 0
10 10 100
8 5 36
Output:
NO
YES
YES
YES
NO
Test case 1: There is no way for Chef to score exactly 4 marks.
Test case 2: Chef can score 12 marks by receiving 6 marks in 2 problems and 0 marks in 1 problem.
Test case 3: Chef can score 0 marks by receiving 0 marks in each of the 4 problems.
Test case 4: Chef can score 100 marks by receiving 10 marks in each of the 10 problems.
Test case 5: There is no way for Chef to score exactly 36 marks.
# cook your dish here
t=int(input())
for i in range(t):
A,B,C=list(map(int,input().split()))
if C%B==0:
print("YES")
else:
print("NO")
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int n,x,y;
cin>>n>>x>>y;
if(y%x==0){
cout<<"YES\n";
}
else{
cout<<"NO\n";
}
}
return 0;
}
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
int x=sc.nextInt();
int y=sc.nextInt();
if(y%x==0 ||y==0)
System.out.println("YES");
else
System.out.println("NO");
}
}
}
In our experience, we suggest you solve this Test Score CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Test Score CodeChef Solution
I hope this Test Score CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>