fork 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.02s 27704KB
stdin
1
1 999999999999999999 1000000000000000000
stdout
1