Problem:


Score : 100 points

Problem Statement

How many multiples of d are there among the integers between L and R (inclusive)?

Constraints

All values in input are integers.

1 \leq L \leq R \leq 100

1 \leq d \leq 100

Input

Input is given from Standard Input in the following format:

L R d

Output

Print the number of multiples of d among the integers between L and R (inclusive).

Sample Input 1

5 10 2

Sample Output 1

3

Among the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.

Sample Input 2

6 20 7

Sample Output 2

2

Among the integers between 6 and 20, there are two multiples of 7: 7 and 14.

Sample Input 3

1 100 1

Sample Output 3

100



Sample input:
5 10 2


Sample output:
3

Submission status: Accepted

Solution code:
L, R, d = map(int,input().split())
cnt = 0
for i in range(L,R+1):
    if i % d == 0:
       cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())

ans = 0
for x in range(L, R+1):
    if x%d == 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
l,r,d = map(int, input().split())
ans = 0
for i in range(l,r+1):
    if (i%d==0):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
ans=0
for i in range(a,b+1):
    if i%c==0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
# = int(input())
# = str(input())
L, R, d = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]
count = 0

for i in range(L, R+1):
    if i % d == 0:
        count += 1

print(count)

Submission status: Accepted

Solution code:
l,r,d = map(int,input().split())

count = 0
for i in range(l,r+1):
    if i%d == 0:
        count += 1

print(count)

Submission status: Accepted

Solution code:
L,R,D = map(int,input().rstrip().split(" "))
ans = 0
for i in range(L,R+1):
    if i % D == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
con = 0;
l,r,d = map(int,input().split());

for i in range(l,r+1):
    if i % d == 0:
        con += 1;
print(con);

Submission status: Accepted

Solution code:
l,r,d=map(int,input().split())
ans=0
for i in range(l,r+1):
  if i%d==0:ans+=1
print(ans)

Submission status: Accepted

Solution code:
(L, R, d) = [int(n) for n in input().split()]

ans = 0
for i in range(L, R+1):
    if i % d == 0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.readline


def main():
  L, R, D = list(map(int, input().split()))

  ans = 0
  for i in range(L, R+1):
    if i % D == 0:
      ans += 1
  print(ans)


if(__name__ == '__main__'):
  main()

Submission status: Accepted

Solution code:
L,R,d = map(int,input().split())
count = 0
for i in range(L,R+1):
  if i%d==0:
    count += 1
print(count)

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

l, r, d = MAP()

ans = 0
for i in range(l, r+1):
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a, b, d = map(int, input().split())
print(b//d - (a-1)//d)

Submission status: Accepted

Solution code:
def resolve():
    l,r,d = map(int, input().split())
    print(r//d -(l-1)//d)

resolve()

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
ans = 0
for i in range(L, R + 1):
    if i %  d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())

count = 0
for i in range(L, R+1):
    if i % d == 0:
        count += 1
    
print(count)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
cnt = 0
for num in range(L, R + 1):
    if num % d == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())

count = 0
for i in range(L, R + 1):
    if i % d == 0:
        count += 1

print(count)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
print((R//d)-((L-1)//d))

Submission status: Accepted

Solution code:
l,r,d = map(int,input().split())
c = 0
for i in range(l,r+1):
	if i%d == 0:
		c += 1
print(c)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())

ans = 0

for a in range(l, r+1):
    if a % d == 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
L, R, d = map(int,input().split())
cnt = 0
for i in range(L, R+1):
  if i % d == 0:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())

result_sum = 0
for i in range(l,r+1):
    if i % d == 0:
        result_sum += 1

print(result_sum)

Submission status: Accepted

Solution code:
def main():
    l, r, d = map(int, input().split())
    cnt = 0
    for i in range(l, r+1):
        if i % d == 0:
            cnt += 1
    print(cnt)


main()

Submission status: Accepted

Solution code:
l,r,d = map(int, input().split())
ans = 0
for i in range(l,r+1):
    if i%d==0:
        ans +=1

print(ans)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    L,R,d = map(int, readline().split())

    ans = 0
    for i in range(L,R+1):
        if i % d == 0:
            ans += 1
    
    print(ans)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())
counter = 0

for i in range(l, r+1):
  if i % d == 0:
    counter += 1
print(counter)

Submission status: Accepted

Solution code:
L,R,d = map(int, input().split())

Sum = 0

for i in range(L,R+1):
    if i % d == 0:
        Sum += 1

print(Sum)

Submission status: Accepted

Solution code:
l,r,d=list(map(int,input().split()))
print(r//d-(l-1)//d)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
ans=0
for i in range(a,b+1):
  if i%c==0:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
l,r,d=map(int,input().split())
cou=0
for i in range(l,r+1):
    if(i%d==0):
        cou+=1
print(cou)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
num = 0
for i in range(L, R+1):
  if i % d == 0:
    num += 1
print(num)

Submission status: Accepted

Solution code:
l,r,d = map(int, input().split())
ans = 0
for i in range(l, r+1):
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# n = int(input())
l, r, d = map(int, input().split())
# a = list(map(int, input().split()))

ans = 0
for i in range(l, r+1):
    if i % d == 0:
       ans += 1
print(ans)

Submission status: Accepted

Solution code:
#6 20 7
a,b,m = map(int, raw_input().split())
c = 0
for i in range(a,b+1): 
	if i % m == 0: c+=1
print c

Submission status: Accepted

Solution code:
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))


def solve():
    l, r, d = map(int, input().split())

    count = 0
    for i in range(l, r+1):
        if i % d == 0:
            count += 1

    return count


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


L, R, d = na()
print(R//d - (L-1) // d)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())

cnt = 0
for i in range(l, r+1):
    if i%d == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
l,r,d=map(int,input().split())
c=0
for i in range(l,r+1):
  if i%d==0:c+=1
print(c)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
ans = sum(i % d == 0 for i in range(L, R + 1))
print(ans)

Submission status: Accepted

Solution code:
L,R, d = map(int,input().split())
ans = 0
for i in range(L, R+1):
    if i%d == 0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
l,r,d=map(int, input().split())
cnt=0
for i in range(l,r+1):
    if i%d==0:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
l,r,d = map(int,input().split())
ans = 0
for i in range(l,r+1):
    if i %d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
L,R,d=map(int,input().split())

ans=0
for n in range(L,R+1):
    if n%d==0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
a,b,c = list(map(int,input().split()))

res = 0
for i in range(a,b+1):
  if i%c == 0:
    res += 1

print(res)

Submission status: Accepted

Solution code:
"""    Arnab Chanda    """

from collections import defaultdict, deque
from itertools import permutations
from sys import stdin,stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq

int_input=lambda : int(stdin.readline())
string_input=lambda : stdin.readline().split()
multi_int_input =lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input=lambda : list(map(int,stdin.readline().split()))
string_list_input=lambda: list(string_input())
MOD = pow(10,9)+7


count  = 0
l, r, d = multi_int_input()

for i in range(l, r+1):
    if i%d == 0:
        count+=1

print (count)

Submission status: Accepted

Solution code:
L,R,D = map(int, input().split())
res = 0
for i in range(L,R+1):
    if i%D == 0:
        res += 1
print(res)

Submission status: Accepted

Solution code:
tok = input().split()
l = int(tok[0])
r = int(tok[1])
d = int(tok[2])

res = 0
for x in range(l, r + 1):
  if x % d == 0:
    res += 1
print(res)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())

ans = 0
for num in range(l, r+1):
    if num % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
# from collections import defaultdict, deque
# import math
# import copy
from bisect import bisect_left, bisect_right
# import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 1000000007

def solve():
    l, r, d = getList()
    ans = 0
    for i in range(l, r +1):
        if i % d == 0:
            ans += 1

    print(ans)



def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    # main()
    solve()

Submission status: Accepted

Solution code:
def main():
    L, R, d = map(int, input().split())

    ans = 0
    for i in range(L, R+1):
        if i % d == 0:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
import itertools
import collections
import bisect
import heapq

def IN(): return int(input())
def sIN(): return input()
def MAP(): return map(int,input().split())
def LMAP(): return list(map(int,input().split()))
def TATE(n): return [input() for i in range(n)]
MOD = 10**9 + 7

l,r,d = MAP()
ans = 0

for i in range(l,r+1):
  if i%d == 0:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
L, R, d = list(map(int, input().split()))

ans = 0
for i in range(L, R+1):
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
ans = 0
for x in range(L, R+1):
    if x % d == 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
L, R, D = map(int, input().split())
count = 0
for i in range(L, R + 1):
    if i % D == 0:
        count += 1

print(count)

Submission status: Accepted

Solution code:
L, R, D = map(int, input().split())
ans = 0
for x in range(L, R + 1):
    if not x % D:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())

cnt = 0
for i in range(l, r + 1):
    if i % d == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())
ans = 0
for i in range(l,r+1):
    if i % d == 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
l,r,d=map(int,input().split())

a=r//d
b=(l-1)//d
print(a-b)

Submission status: Accepted

Solution code:
l, r, d = map(int,input().split())

c = 0
for i in range(l, r+1):
    if i % d == 0:
        c += 1

print(c)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
ans = 0
for i in range(L, R+1):
    if i%d==0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    l, r, d = i_map()

    count = 0
    for i in range(l,r+1):
        if i % d == 0:
            count += 1

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!python3

LI = lambda: list(map(int, input().split()))

# input
L, R, d = LI()


def main():
    a = (L - 1) // d
    b = R // d
    ans = b - a
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())
res = 0
for i in range(l, r + 1):
    if i % d == 0:
        res += 1
print(res)

Submission status: Accepted

Solution code:

def main():
    l,r,d = map(int,input().split())
    count = 0
    for i in range(l,r+1):
        if i % d == 0:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
# = int(input())
# = input()


ans = R // d - (L - 1)//d 
print(ans)

Submission status: Accepted

Solution code:

[L,R,d] = list(map(int,input().split()))

count=0
for i in range(L,R+1):
    if i%d ==0:
        count+=1
print(count)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
count = 0
for i in range(L, R+1):
    if i % d == 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())
ans = 0
for x in range(l, r + 1):
    if x % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a, b, c=map(int, input().split())
ans=0
for i in range(a,b+1):
  if i%c==0:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
l,r,d=map(int,input().split())
ans=r//d-(l-1)//d
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

l, r, d= rm()
r //= d
l = (l-1)//d
print(r-l)

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def main():
    l,r,d=map(int,input().split())
    count=0
    for i in range(l,r+1):
        if i%d==0:
            count+=1
    print(count)





if __name__ == "__main__":

    main()

Submission status: Accepted

Solution code:
s=0
L,R,d=map(int,input().split())
for i in range(L,R+1):
  if i%d==0:
    s+=1
print(s)

Submission status: Accepted

Solution code:
l,r,d = map(int,input().split())

print(r // d - (l-1) // d)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
count = 0
for i in range(L, R+1):
    if i%d == 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
def examA():
    L, R, D = LI()
    ans = R//D - (L-1)//D
    print(ans)
    return

def examB():

    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(2*10**6)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

l, r, d = map(int, input().split())
ans = 0
for i in range(l, r+1):
    if i%d == 0: ans += 1
print(ans)

Submission status: Accepted

Solution code:
l,r,d=map(int,input().split())
l-=1
print(r//d-l//d)

Submission status: Accepted

Solution code:
L, R, D = map(int, input().split())

ans = 0
for i in range(L, R + 1):
    if (i % D) == 0:
        ans += 1

print (ans)

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())

c = 0

for i in range(L, R + 1):
    if i % d == 0:
        c += 1

print(c)

Submission status: Accepted

Solution code:

L,R,d = list(map(int, input().split()))
cnt = 0
for i in range(L,R+1):
    if i % d==0:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque



def run():
    L, R, d = map(int, input().split())
    ans = R // d - (L-1) // d
    print(ans)



if __name__ == "__main__":
    run()

Submission status: Accepted

Solution code:
L,R,X=[int(s) for s in input().split()]
count=0
for i in range(L,R+1):
  if i%X==0:
    count+=1
print(count)

Submission status: Accepted

Solution code:
L,R,d = map(int,input().split())
count = 0
for i in range(L,R+1):
    if i%d == 0:
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
l,r,d = map(int,input().split())

l -= 1
print(r//d-l//d)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (
    acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians,
    sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


def main():
    res = 0
    l, r, d = invr()
    for i in range(l, r+1):
        if i % d == 0:
            res += 1
    print(res)


    # region fastio
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
def input(): return sys.stdin.readline().rstrip("\r\n")

# endregion


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

L, R, d = ri_()
ans = 0
for i in range(L, R + 1):
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

l, r, d = map(int, input().split())
ans = 0
for i in range(l, r+1):
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
l, r, d = map(int, input().split())

ans = 0
for i in range(l, r + 1):
    if i % d == 0:
        ans += 1

print(ans)