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=list(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())
res=0
for i in range(l,r+1):
    if i%d==0:res+=1
print(res)

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 = r//d-(l-1)//d
print(ans)

Submission status: Accepted

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

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

print(ans)

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)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    l,r,d=INTM()
    ct=0
    for i in range(l,r+1):
        if i%d==0:
            ct+=1
    print(ct)
if __name__ == '__main__':
    do()

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())
print(len([i for i in range(L, R + 1) if i % d == 0]))

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def MS(): return map(str, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
# N = I()
# A = [LI() for _ in range(N)]

l,r,d = MI()





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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
l, r, d = M()
ans = 0
for i in range(l, r+1):
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    L, R, d = NMI()
    print(R//d - (L-1)//d)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#create date: 2020-07-11 21:00

import sys
stdin = sys.stdin

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

def main():
    l, r, d = na()
    print(r//d - (l-1) //d)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def solve():
    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__':
    solve()

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())

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:
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:
import math  # noqa: F401
from collections import deque  # noqa: F401
from typing import Deque, Dict, List, Optional, Tuple, Union  # noqa: F401


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


if __name__ == "__main__":
    L, R, d = map(int, input().split())
    main(L, R, d)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    l, r, d = LI()
    ans = r//d - (l-1) //d 
    print(ans)
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:
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:
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())
print(R // d - (L-1) // d)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Accepted

Solution code:
L, R, d = [int(x) for x 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:
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())
u = r//d
ud = (l-1)//d
print(u-ud)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    l, r, d = nm()
    print(r//d - (l-1)//d)
    return

solve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    L, R, d = [int(x) for x in input().split()]
    print(R // d - (L - 1) //d)



if __name__ == '__main__':
    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:
#!/usr/bin/env python3

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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())
print(R // d - (L - 1) // d)

Submission status: Accepted

Solution code:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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())

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
import sys
import math

A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
cnt = 0
for i in range(A, B+1):
    if i % C == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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 sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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

#処理内容
def main():
	L, R, D = getlist()
	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())

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

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())

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


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:
[l,r,d] = [int(i) for i 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:
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:
import sys
sys.setrecursionlimit(10**8)
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:
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:
# -*- coding: utf-8 -*-
# A

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

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:
L,R,d = [int(_n) for _n in input().split()]
a = 0
for i in range(L,R+1):
    if i % d == 0:
        a+=1
print(a)

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 n in range(L, R + 1):
    if n % 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())
print(R//D-(L-1)//D)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
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 print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False
# show_flg = True


def main():
    L, R, d = MI()
    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())
ans = 0
for i in range(l,r+1):
    if i%d == 0:
        ans+=1
print(ans)

Submission status: Accepted

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

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

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

    return

if __name__ == '__main__':
    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:
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:
#

import sys
input=sys.stdin.readline

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)
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

L, R, d = MAP()
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())
res = r//d - (l - 1)//d
print(res)

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:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


l, r, d = LI()
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)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
L, R, D = map(int, input().split())
res = 0
for x in range(L, R + 1): res += x % D == 0
print(res)

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:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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 = 0
for i in range(l, r+1):
    ans += i % d == 0
print(ans)

Submission status: Accepted

Solution code:
#import numpy as np
#import functools
#import operator
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm
#import collections as C #most_common
#import math
#import sympy

#N = int(input())
N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
#S = str(input())
#T = str(input())

c=0
for i in range(N,K+1):
    if i%d==0:
        c+=1
print(c)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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:
#n = int(input())
l,r,d = map(int,input().split())
#a_L = 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())
print(R // d - (L-1) // d)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

L, R, d = MAP()

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

Submission status: Accepted

Solution code:
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = 0

L,R,d = I()

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(1000000)

import bisect
import math
import collections
import heapq


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


if __name__ == "__main__":
    L, R, d = tuple(map(int, input().split(" ")))
    print(solve(L, R, d ))

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:
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:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    #n = int(stdin.readline().rstrip())
    l,r,d = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    ans = 0
    for i in range(l,r+1):
        if i%d == 0:
            ans += 1
    print(ans)

if __name__ == '__main__':
    solve()

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 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)

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 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())
#l=list(map(int,input().split()))
#l=[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())

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

Submission status: Accepted

Solution code:
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

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:
# import sys
# input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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

print(cnt)

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
from operator import mul

INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 組合せnCr
def combinations_count(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定
def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True


# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret

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]



# ここから書き始める
l, r, d = map(int, input().split())
ans = 0
for i in range(l, r + 1):
    if i % d == 0:
        ans += 1
print(ans)