Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

Codechef Test Score problem solution

YASH PAL, 31 July 202427 January 2026

In this Codechef Test Score problem solution In a test, there are NN problems, each carrying XX marks. In each problem, Chef either received XX marks or 00 marks. Determine whether is it possible for Chef to achieve exactly YY marks.

Codechef Test Score problem solution

Codechef Test Score problem solution in Python.

for i in range (int(input())):
    n,x,y=map(int,input().split())
    if ((n*x)-y)%x==0:
        print("yes")
    else:
        print("no")

Test Score problem solution in Java.

/* 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();
		for(int i = 0;i< T; i++){
		    int N = sc.nextInt();
		    int X = sc.nextInt();
		    int Y = sc.nextInt();
		    
		        if( Y % X == 0){
		            System.out.println("yes");
		        }else{
		            System.out.println("NO");
		        }
		       
		    
		     
		}
	}
}

Problem solution in C++.

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
	    int n , x , y;
	    cin>>n>>x>>y;
	    if(y%x==0){
	        cout<<"Yes"<<endl;
	        
	    }
	    else{
	        cout<<"No"<<endl;
	    }
	
}
return 0;
}

Problem solution in C.

#include <stdio.h>

int main(void) {
	// your code goes here
	int t,n,x,y;
	scanf("%d",&t);
	while(t--)
	{
	    scanf("%d%d%d",&n,&x,&y);
	    if(y%x!=0)
	    printf("non");
	    else
	      {
	          if(y/x<=n)
	          printf("yesn");
	          else
	          printf("non");
	      }
	}
	return 0;
}
Codechef Solutions coding problems solutions

Post navigation

Previous post
Next post

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes