#K57977. Minimum Maximum Power Key Distribution

    ID: 30540 Type: Default 1000ms 256MiB

Minimum Maximum Power Key Distribution

Minimum Maximum Power Key Distribution

You are given two integers \(M\) and \(P\). Here, \(M\) represents the number of keys and \(P\) represents the total sum of the powers of all keys. The task is to distribute the power among the keys so that the maximum power assigned to any key is as small as possible.

Let \(base = \lfloor \frac{P}{M} \rfloor\) and \(r = P \mod M\). Then, the minimum possible maximum power is given by:

\[ \text{answer} = \begin{cases} base, & \text{if } r = 0, \\ base + 1, & \text{if } r > 0. \end{cases} \]

Read the input from standard input and output the answers to standard output, one answer per test case.

inputFormat

The first line contains an integer \(T\) representing the number of test cases. Each of the next \(T\) lines contains two space-separated integers \(M\) and \(P\), where \(M\) is the number of keys and \(P\) is the total power.

outputFormat

For each test case, output the minimum possible maximum power of the keys on a new line.

## sample
3
2 17
3 20
5 100
9

7 20

</p>