Round 1 Confusion Problem Code: CR0Submit
Hey congratulate you all for qualified upto final Round, but this is not the end, final round it still remaining for that you need to crack some more problems. So here we go.
Our team is in confusion that how to work efficiect in given period of time. There are total paper's out of which are already checked and there are total crew members to check the paper's.
But now we want to divide the paper's among our crew member, how sholud we divide the paper among us such that all get same no. of paper with minimum possibility.
Please help from this confusion as we running out of time.
Input:
First line will contain , number of testcases. Then the testcases follow.
The first line of each test case contains three space separated integers , and .
where and are multiple of .
Output:
- For each test case print a single line containing a single integer denoting no. of paper with minimum possibility that each crew member get.
Constraints
Subtasks
- 100 points : Original Constraints
Sample Input:
2
20 4 8
15 3 9
Sample Output:
3
2
------------------------------------------------------
solution in cpp
#include<iostream>
using namespace std;
int main()
{
int n, k, x, sum;
int t;
cin >> t;
for (int i = 0; i < t; i++)
{
cin >> n >> k >> x;
sum = 0;
sum += (n / k) - (x / k);
cout << sum << "\n";
}
cout << "\n";
return 0;
}
No comments:
Post a Comment