Algorithm
.problem link:https://www.codechef.com/problems/DETSCORE
ProblemAdmin
Chef appeared for a placement test.
There is a problem worth points. Chef finds out that the problem has exactly test cases. It is known that each test case is worth the same number of points.
Chef passes test cases among them. Determine the score Chef will get.
NOTE: See sample explanation for more clarity.
Input Format
- First line will contain , number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, two integers and , 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
- is a multiple of .
Sample 1:
4 10 3 100 10 130 4 70 0
3 100 52 0
Explanation:
Test Case : The problem is worth points and since there are test cases, each test case is worth point. Since Chef passes test cases, his score will be points.
Test Case : The problem is worth points and since there are test cases, each test case is worth points. Since Chef passes all the test cases, his score will be points.
Test Case : The problem is worth points and since there are test cases, each test case is worth points. Since Chef passes test cases, his score will be points.
Test Case : The problem is worth points and since there are test cases, each test case is worth points. Since Chef passes test cases, his score will be points.
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h> int main(void) { int t,x,n,p; scanf("%d",&t); while(t--) { scanf("%d %d",&x,&n); p=(x/10)*n; printf("%d\n",p); } return 0; }.Copy The Code & Try With Live Editor
Input
10 3
100 10
130 4
70 0
Output
100
52
0
Demonstration
CodeChef solution DETSCORE - Determine the Score CodeChef solution C,C+