#C6041. Complete Teams and Unpaired Players

    ID: 49758 Type: Default 1000ms 256MiB

Complete Teams and Unpaired Players

Complete Teams and Unpaired Players

You are given T test cases. For each test case, you are provided with two integers:

  • P: The total number of players
  • K: The size of each team

Your task is to determine the number of complete teams that can be formed, and the number of players that remain unpaired after forming these teams.

The formulas to be used are:

  • \( \text{complete teams} = \lfloor P / K \rfloor \)
  • \( \text{unpaired players} = P \bmod K \)

Input is to be read from the standard input (stdin) and the result for each test case should be printed on a new line in the format "complete_teams unpaired_players" to the standard output (stdout).

inputFormat

The first line of input contains an integer T which represents the number of test cases. The next T lines each contain two space-separated integers P and K, where P is the total number of players and K is the team size.

T
P1 K1
P2 K2
...
PT KT

outputFormat

For each test case, output a single line containing two integers separated by a space: the number of complete teams that can be formed and the number of unpaired players.

complete_teams unpaired_players
## sample
3
10 2
15 3
8 4
5 0

5 0 2 0

</p>