Calculation of Grades
All submissions for this problem are available.
NITD has a unique system of assigning grades to the students. The
marks of the student in various exams are summed up, and divided
by the marks given to each student in internal assessment. Let us
call this decimal number D. Then, a number N is chosen by the
teacher, and the number at the Nth digit after the decimal place is
used to assign the grade. You have come across all the values
needed, and have decided to calculate the digits that will then be
used to assign grades.
The first line of input will consist of an integer T, denoting the
number of test cases.
For each test case, there will be two lines.
The first line will consist of two integers X, the sum of the number of
marks obtained by the student in various exams, and Y, the marks
given to the student in internal assessment, separated by a ‘/’
character (without the quotes).
The next line will have the integer N.
For each test case, output the digit that will be used to assign the
grade on a line by itself.
- 1 <= T <= 1000
- 1 <= X, Y <= 10^6
- 1 <= N <= 10^5
Input: 2 5/2 1 10/3 5 Output: 5 3
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.