Skip to content

Latest commit

 

History

History

ishaans-weight

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Ishaans Weight

Ishaan is getting really fat. He wants to lose his weight but can't get the motivation to workout. Seeing this, his friend Charul offers him a deal. For every K pushups Ishaan does, Charul will give him money equal to the number of pushups Ishaan has done till then (Refer Example for Explanation). Find out the amount of money he made if he does N pushups.

Input Format
The first line of input contains a single integer T denoting the number of test cases.
The only line of each test case contains 2 space-separated integers N and K.

Output Format
For each test case, print the required answer in a new line.

Constraints
1 <= T <= 200
1 <= N <= 10^9
1 <= K <= 10^5

Sample Input
3
5 2
5 3
5 6

Sample Output
6
3
0