#K71702. Cupcake Distribution

    ID: 33590 Type: Default 1000ms 256MiB

Cupcake Distribution

Cupcake Distribution

In this problem, you are given a number of cupcakes that come in boxes, with each box containing exactly (M) cupcakes. There are (L) people, and each person should receive one cupcake. Your task is to determine the minimum number of boxes required such that every person gets a cupcake, and also compute how many extra cupcakes are left after the distribution.

Formally, if you buy (B = \lceil \frac{L}{M} \rceil) boxes, then the total number of cupcakes is (B \times M) and the number of extra cupcakes is (B \times M - L). For example, if (M = 6) and (L = 10), then you need (\lceil 10/6 \rceil = 2) boxes which makes a total of 12 cupcakes, leaving 2 extra cupcakes.

inputFormat

The first line contains an integer (T) representing the number of test cases. Each of the following (T) lines contains two space-separated integers (M) and (L), where (M) is the number of cupcakes in one box and (L) is the number of people.

outputFormat

For each test case, output a single line with two space-separated integers: the minimum number of boxes required and the number of extra cupcakes left over.## sample

5
6 10
8 15
5 14
10 100
3 7
2 2

2 1 3 1 10 0 3 2

</p>