#K73837. Stamps and Pages
Stamps and Pages
Stamps and Pages
You are given a collection of stamps that need to be arranged on pages. Each page can hold at most k stamps. For a given number of stamps n, determine how many pages can be completely filled, and how many stamps will be placed on the next (incomplete) page if any.
The solution involves using integer division and the modulus operator. In mathematical terms, if you have n stamps and each page can hold k stamps, then the number of completely filled pages is given by \( \lfloor n / k \rfloor \) and the number of stamps on the next page is \( n \bmod k \).
Input and output will be through standard input and standard output.
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: n (the number of stamps) and k (the capacity of each page).
outputFormat
For each test case, output two integers separated by a space. The first integer is the number of completely filled pages, and the second integer is the number of stamps on the next page. Each result should be printed on a new line.## sample
1
35 10
3 5