#K79137. Counting Multiples
Counting Multiples
Counting Multiples
You are given a positive integer (P) and a divisor (M). The task is to count how many multiples of (M) exist between 1 and (P) (inclusive). In mathematical notation, you need to compute (\lfloor \frac{P}{M} \rfloor) for each test case.
Input begins with an integer (T) representing the number of test cases, followed by (T) lines, each containing two integers (P) and (M). For each test case, output the count of multiples of (M) up to (P) on a new line.
inputFormat
The first line contains an integer (T) denoting the number of test cases. Each of the following (T) lines contains two space-separated integers (P) and (M), where (P) is the limit and (M) is the divisor.
outputFormat
For each test case, print a single integer representing (\lfloor \frac{P}{M} \rfloor), i.e., the number of multiples of (M) in the range [1, (P)]. Each answer should be printed on a new line.## sample
3
10 3
15 5
20 7
3
3
2
</p>