BETA

Difficulty Level:

Basic

Total Submissions: 680 Accuracy:

41.03%

Count numbers divisible by M
     

Given two numbers A and B which define a range, where A < B. Find the count of total numbers in the given range [A … B] divisible by 'M'.

Input:

First line of input contains a single integer T which denotes the number of test cases. Then T test cases follows. First line of each test case contains three space separated integers A, B and M.

Output:
For each test case, print the count of total numbers in the given range [A … B] divisible by 'M'.

Constraints:
1<=T<=100
1<=A<=103
A<B<=105

Example:
Input:

2
25 100 30
6 15 3
Output:
3
4

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Harsh Agarwal

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.