DWITE, November 2012, Problem 1
After collecting all the candy you could get at Halloween, you decided to eat all of that candy as fast as possible! However, after having eaten some of them you get a sugar rush, enabling you to eat the remaining pieces even faster! Before starting, you want to calculate how long it will take you to eat all of your candy. From previous Halloweens, you noticed that you start eating one piece of candy at a time (i.e. one piece per mouthful). However, after having eaten
Note: you can only get one sugar rush at a time, even if you eat
The input will contain 5 test cases. Each test case is a line with two integers,
The output will contain 5 lines of output. Each a single integer — the minimum number of mouthfuls necessary to eat all
Sample Input
10 1
10 5
Sample Output
4
8
Problem Resource: DWITE
Comments