#K42282. Divide Teams Evenly

    ID: 27053 Type: Default 1000ms 256MiB

Divide Teams Evenly

Divide Teams Evenly

In this problem, you are given a number of employees N and a desired number of teams K. Your task is to determine if it is possible to evenly distribute the employees among the teams. In mathematical terms, you need to check if N is divisible by K (i.e. if \(N \mod K = 0\)). If the condition holds, then each team will have \(\frac{N}{K}\) employees; otherwise, the distribution is not possible and you should output -1.

For each test case, output the number of employees per team if the teams can be evenly formed, or -1 if they cannot be.

inputFormat

The first line contains a single integer T denoting the number of test cases. Each of the next T lines contains two space-separated integers N and K, where N is the total number of employees and K is the number of teams.

outputFormat

For each test case, print a single line containing the number of employees per team if N can be evenly divided by K; otherwise, print -1.

## sample
4
10 2
15 4
30 3
25 5
5

-1 10 5

</p>