All submissions for this problem are available.
A weightlifter has the regular habit of lifting weights up to a total weight TW assigned by his trainer. He lifts the same weight SW multiple times to complete the limit. When he finds that SW is greater than the remaining weight, he leaves for his home. The same routine is followed every day. The weightlifter is not good with calculations. He needs your help to find the remaining weight and the number of times he lifts weight for each day. Consider that weightlifter goes everyday to the gym without skipping holidays and TW is nonzero only if SW is nonzero.
First line of input will contain the number of days D. Each of the test case is described in two lines TW and SW.
You have to output the remaining weight and the number of times he lifts weight separated by a space for each day. Also the output for each day should be in a new line.
0 ≤ TW ≤ 10^100
0 ≤ SW ≤ 10^18
1 ≤ D ≤ 10^5
Input: 1 132436 23 Output: 2 5758
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, GO|
Fetching successful submissions