All submissions for this problem are available.
The Riddler has a simple question for you. You have to tell him the count of numbers between A and B (A<=B)which are divisible by M.
For every test case , print the answer in a new line.
The first line contains an integer T, total number of testcases. Then follow T lines, each line contains A, B and M respectively as described above.
For every test case print the answer in a new line.
- 1 ≤ T ≤ 10^5
- 1 ≤ A ≤ 10^9
- 1 ≤ B ≤ 10^9
- 1 ≤ M ≤ 10^9
SubtasksSubtask #1 (20 points), Time limit : 1 sec
1 ≤ T ≤ 10, 1 ≤ A,B,M ≤ 10^5
Subtask #2 (80 points), Time limit : 1 sec
Input: 2 1 3 1 2 6 2 Output: 3 3
In the sample input 1, there are 3 numbers between 1 and 3 which are divisible by 1. Hence, answer is 3.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions