#C7934. Distribute Candies

    ID: 51860 Type: Default 1000ms 256MiB

Distribute Candies

Distribute Candies

In this problem, you are given t test cases. In each test case, there are two integers n and m, where n represents the number of friends and m represents the total number of candies.

For each test case, every friend will receive \(\lfloor \frac{m}{n} \rfloor\) candies, and the remaining candies are \(m \bmod n\). Your task is to calculate these two numbers for each test case.

Note: The operation \(\lfloor \frac{m}{n} \rfloor\) denotes the floor division (i.e. the integer part of the division), and \(m \bmod n\) denotes the remainder after division.

inputFormat

The first line of input contains a single integer t, which denotes the number of test cases.

Each of the next t lines contains two space-separated integers n and m where:

  • n is the number of friends, and
  • m is the total number of candies.

outputFormat

For each test case, output two integers separated by a space. The first integer is the number of candies each friend receives, and the second integer is the number of candies remaining in the box.

Each test case's result should be printed on a new line.

## sample
1
3 10
3 1

</p>