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())
pq = 0
for x in range(R+1):
    y = d * x
    if y>=L and y<=R:
        pq += 1
print(pq)

Submission status: Accepted

Solution code:
L, R, d  = map(int, input().split())
lst = list()
for x in range(R+1):
    y = d * x
    if y>=L and y<=R:
        lst.append(y)
print(len(lst))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# L 以上 R 以下の整数のうち、d の倍数であるようなものはいくつありますか？
l, r, d = map(int, input().split())
# d の倍数
ans = 0
for i in range(l, r+1):
    # L 以上 R 以下の整数が割り切れるかどうか
    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):
    # print(i)
    if i % d == 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a, z, mult = input().split()

a, z, mult = int(a), int(z), int(mult)

cont = 0
for i in range(a, z+1):
    if i%mult == 0:
        cont += 1;
        
print(cont)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if a%c==0:
	l=a 
else:
	l=(a//c+1)*c 
if b%c==0:
	u=b 
else:
	u=(b//c)*c 
#print(l,u)
print(max(0,(u-l)//c+1))

Submission status: Accepted

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

# A - Number of Multiples
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 = list(map(int,input().strip().split()))
print(R//d-(L-1)//d)

Submission status: Accepted

Solution code:
l, r, d = [int(i) for i in input().split(" ")]
l -= 1
print(r//d - l//d)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
count = 0
l, r, d= [int(x) for x in readline().rstrip().split()]
#print(l,r,d)
for i in range(l,r+1):
    if i % d == 0:
        count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
input=sys.stdin.readline

l,r,d=map(int,input().split())
cnt1=r//d
cnt2=(l-1)//d
print(cnt1-cnt2)

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys


def main():
    input = sys.stdin.buffer.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)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
inputLine = [int(i) for i in input().split()]
L = inputLine[0]
R = inputLine[1]
d = inputLine[2]
count = 0
for x in range(L,R+1):
  if ( x%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())
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())
print(r//d-~-l//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:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
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(R//d-(L-1)//d)

Submission status: Accepted

Solution code:
L, R, d = input().split()
if int(L)%int(d) == 0:
    print(int(R)//int(d) - int(L)//int(d) + 1)
else:
    print(int(R)//int(d) - int(L)//int(d))

Submission status: Accepted

Solution code:
[L,R,d] = map(int,input().split())
n = R - L + 1
c = 0
for i in range(n):
    if (L + i) % d == 0 :
        c = 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:
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())
s=r//d-l//d
if l%d==0:s+=1
print(s)

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 math import ceil
l,r,d=map(int,input().split())
print(r//d-ceil(l/d)+1)

Submission status: Accepted

Solution code:
l,r,d=map(int,input().split())
ans = 0
while l<=r:
	if l%d==0:
		ans+=1
	l+=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 = [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:
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:
a,b,c=map(int,input().split())
n=b//c
y=(a-1)//c
print(n-y)

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 math
#from queue import *
#import random
#sys.setrecursionlimit(int(1e6))
input = sys.stdin.readline
 
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input()))
def inara():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))
################################################################
############ ---- THE ACTUAL CODE STARTS BELOW ---- ############

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

Submission status: Accepted

Solution code:
import sys

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

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

Submission status: Accepted

Solution code:
x,y,z=map(int,input().split())
print(y//z-(x-1)//z)

Submission status: Accepted

Solution code:
L,R,d = (int(X) for X in input().split())
print(sum([True for T in range(L,R+1) if T%d==0]))

Submission status: Accepted

Solution code:
li =list(map(int,input().split()))
n =li[0]
m =li[1]
k =li[2]
count =0
for i in range(n,m+1):
    if i%k ==0:
        count +=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def count(n, d):
    return n // d


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
l, r, d = map(int, input().split())
print(r//d - (l-1)//d)

Submission status: Accepted

Solution code:
L, R, d = map(int, 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())
t = 1
res = 0
while t * d <= R: 
    if L <= t * d <= R:
        res += 1
    t += 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())
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:
a, b, c =map(int, input().split())
d=(a-1)//c
e=b//c
ans=e-d
print(ans)

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    l, r, d = map(int, input().split())
    print(r // d - (l - 1) // d)
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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())
print(R//D-(L-1)//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
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
l,r,d=map(int,input().split())
c=0
for i in range(1,101):
  if l<=d*i<=r:
    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:
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
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(L, R, D):
    return R // D - (L-1) // D


def main():
    L, R, D = read_int_n()
    print(slv(L, R, D))


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:
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:
        
try:
    inp = input().split()
    L = int(inp[0])
    R = int(inp[1])
    d = int(inp[2])
    
    if L >= 1 and R >= 1 and L <= R and L<=100 and R<=100 and d>=1 and d<=100:
        counter = 0
        for i in range(L,R+1):
            if i%d == 0:
                counter += 1
        print(counter)
        
except Exception as e:
    print(e)

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]


def main():
	L,R,d = inputMap()

	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:
def main():
    l,r,d = tuple([int(t)for t in 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())
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())
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 = r // d - l // d
if l % 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:
import sys
input = sys.stdin.readline

l,r,d=map(int,input().split())
v1 = l//d
if l%d==0:
    v1-=1
v2 = r//d
print(v2-v1)

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:
# coding: utf-8
# Your code here!

a,b,c=input().split()

#print(a)
#print(b)
#print(c)

i=0
num=int(a)
count=0

while(i!=int(b)-int(a)+1): 
    #print("1")
    if (num%int(c)==0):
        count+=1
    num+=1
    i+=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:
l,r,d=map(int,input().split());print(r//d-~-l//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:
import numpy as np
a, b, c = map(int,input().split())
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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


num_list = list()

for x in range(L, R + 1):
    num_list.append(x)

dmul_list = list()
for i in num_list:
    x = i%d
    if x == 0:
        dmul_list.append(i)

print(len(dmul_list))

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
count = 0
for i in range(a[0], a[1] + 1):
    if i%a[2] == 0:
        count+=1
print(count)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

rest = l%d

if(rest == 0):
	num = int(r/d) - int(l/d) + 1
else:
  	num = int(r/d) - int(l/d)
    
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:
l, r, d = list(map(int, input().split()))
if l % d == 0:
    print(r//d - l//d+1)
else:
    print(r//d - l//d)

Submission status: Accepted

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

for i in range(101):
    if d * i > r:
        break
    elif d * i >= l:
        ans += 1
        continue
    else:
        continue

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

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

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

l,r,d = map(int,readline().split())

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

print(b-a)

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
l=a[0]
r=a[1]
d=a[2]
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:
L,R,d = map(int,input().split())
A = 0
for _ in range(L,R+1):
    if _ %d == 0:
        A += 1
print(A)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(L: int, R: int, d: int):
    ret = R // d - (L - 1) // d
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    L = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    solve(L, R, d)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

L, R, D = map(int, read().split())

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

Submission status: Accepted

Solution code:
l,r,d = map(int,input().split())
a = r // d
b = l // d
ans = a - b
c = r % d
e = l % d
if c == 0 and e == 0:
  print(ans + 1)
else:
  print(ans)

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

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

	ans=(r-l)//d

	a=l+ans*d

	if r//d*d==-(-a//d)*d:
		ans+=1

	print(ans)










if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

if l%d ==0:
  print(r//d - l//d +1)
else:
  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())

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cns)

Submission status: Accepted

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

if R%d == 0:
    print((R-L)//d+1)
else:
    print((R-L)//d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l,r,d = map(int, input().split())
r = r+1
range_list = list(range(l,r))
per_list = []
for i in range_list:
    if i % d == 0:
        per_list.append(i)
    else:
        pass
print(len(per_list))

Submission status: Accepted

Solution code:
def main():
    L, R, d = input_ints()

    print(len([True for i in range(L, R+1) if i % d == 0]))




def input_ints():
    line_list = input().split()

    if len(line_list) == 1:
        return int(line_list[0])
    else:
        return map(int, line_list)


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


def input_int_tuple_list(n: int):
    return [tuple(map(int, input().split())) for _ in range(n)]


main()

Submission status: Accepted

Solution code:
L, R, d = map(int, input().split())
ans = list(map((lambda x: x % d == 0) , [i for i in range(L, R+1)])).count(True)
print(ans)

Submission status: Accepted

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

now = d

count = 0

while now <= r:

    if now >= l:
        count += 1
    
    now += d

print(count)

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 math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
l,r,d=get_ints()
count=0
for i in range(l,r+1):
    if i%d==0:
        count=count+1
print(count)

Submission status: Accepted

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

seq = list(range(L, R+1))
print(len(list(filter(lambda x: x%d==0,seq))))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
l,r,d = (int(i) for i in input().split())
z = int(math.floor(r/d)-math.floor(l/d))
if l%d == 0:
	print(z+1)
else:
	print(z)

Submission status: Accepted

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

r = [i for i in range(L,R+1)]

N = [k for k in r if k % D == 0]

print(len(N))

Submission status: Accepted

Solution code:
a = input().split(" ")
l = 0
g = int(a[0])
h = int(a[1])
s = int(a[2])
i = g
while i <= h :
    if i % s == 0 :
        l = l + 1
    i = i + 1
print(l)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce

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

Submission status: Accepted

Solution code:

s = input()
L, R, d = s.split()
L = int(L)
R = int(R)
d = int(d)

# print(L, R, d)

d1 = d
count = 0

while d1 < L:
    d1 += d
    # print(d1)

while d1 <= R:
    count += 1
    d1 += d

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if b%c==0 or a%c==0:
  print(int((b-a)/c)+1)
else:
  print(int((b-a)/c))

Submission status: Accepted

Solution code:
num = list(map(int, input().split()))
min_range = num[0]
max_range = num[1]
n = num[2]
ans = len([i for i in range(min_range, max_range+1) if i % n <= 0])
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def main():
    L, R, d = get_ints()
    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 = [int(i) for i in range(L, R+1) if i % d == 0]

print(len(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:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
INF = 10**18


if __name__ == "__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)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
L, R, d = map(int, open(0).read().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())
count = 0
for i in range(l, r+1):
    if i%d==0:
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L,R,D=map(int,input().split())
startno = L
while startno % D != 0:
    startno += 1 
lista=list(range(startno,R+1,D))
#print(lista)
print(len(lista))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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