Determine the Score CodeChef Solution

Problem – Determine the Score CodeChef Solution

Chef appeared for a placement test.

There is a problem worth XX points. Chef finds out that the problem has exactly 1010 test cases. It is known that each test case is worth the same number of points.

Chef passes NN test cases among them. Determine the score Chef will get.

NOTE: See sample explanation for more clarity.

Input Format

  • First line will contain TT, number of test cases. Then the test cases follow.
  • Each test case contains of a single line of input, two integers XX and NN, the total points for the problem and the number of test cases which pass for Chef’s solution.

Output Format

For each test case, output the points scored by Chef.

Constraints

  • 1 \leq T \leq 1001≤T≤100
  • 10 \leq X \leq 20010≤X≤200
  • 0 \leq N \leq 100≤N≤10
  • XX is a multiple of 1010.

Sample 1:

Input: 4
10 3
100 10
130 4
70 0

Output: 3
100
52
0

Explanation:

Test Case 1: The problem is worth 1010 points and since there are 1010 test cases, each test case is worth 11 point. Since Chef passes 33 test cases, his score will be 1 \cdot 3 = 31⋅3=3 points.

Test Case 2: The problem is worth 100100 points and since there are 1010 test cases, each test case is worth 1010 points. Since Chef passes all the 1010 test cases, his score will be 10 \cdot 10 = 10010⋅10=100 points.

Test Case 3: The problem is worth 130130 points and since there are 1010 test cases, each test case is worth 1313 points. Since Chef passes 44 test cases, his score will be 13 \cdot 4 = 5213⋅4=52 points.

Test Case 4: The problem is worth 7070 points and since there are 1010 test cases, each test case is worth 77 points. Since Chef passes 00 test cases, his score will be 7 \cdot 0 = 07⋅0=0 points.

Determine the Score CodeChef Solution in Python3

for i in range(int(input())):
    a,b=map(int,input().split())
    print((a//10)*b)

Determine the Score CodeChef Solution in Java

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		while(t-->0)
		{
		    int a=sc.nextInt();
		    int b=sc.nextInt();
		    int c=a/10;
		    System.out.println(c*b);
		}
	}
}

Determine the Score CodeChef Solution in C++17

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
	    int x,n,z,q;
	    cin>>x>>n;
	    
	    z = x/10;
	    q = z*n;
	    cout<<q<<endl;
	    
	}
	return 0;
}
Determine the Score CodeChef Solution Review:

In our experience, we suggest you solve this Determine the 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 Determine the Score CodeChef Solution

Find on CodeChef

Conclusion:

I hope this Determine the 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 >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published.