fork(2) download
  1. import math
  2. for test in range(int(input())):
  3. l,r,g=map(int,input().split())
  4. i=math.ceil(l/g)*g
  5. j=math.floor(r/g)*g
  6. if i==j and i!=g:
  7. print(0)
  8. else:
  9. print((j-i)//g+1)
Success #stdin #stdout 0.01s 27712KB
stdin
2
5 15 4
15 20 35
stdout
2
0