Harryxun/stf_run huggingface dataset:
import math
import sys
sys.setrecursionlimit(10 ** 4)
N, K = map(int, input().split())
R = N - K

if K == 0:
    print (R+1)
    exit()

K_1 = math.factorial(K-1)
R_1 = math.factorial(R+1)
# print (K_1, R_1)
for i in range(1, K+1): #K回答えを出力
    # if i > R:
    #     print (0)
    #     continue
    if i == 1:
        print (R + 1)
        continue
    # print (K_1, R_1, math.factorial(i))
    if i == 2:
        position = R_1//(math.factorial(i) * math.factorial(R + 1- i))
        boal = K_1//(math.factorial(i-1) * math.factorial(K - i))
    if i > 2:
        position = (position * (R + 1 - (i-1))) // i
        boal = (boal * (K - (i-1)))// (i-1)
    print ((position * boal)%(7 + 10 ** 9))

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(10 ** 4)
N, K = map(int, input().split())
R = N - K

if R == 0: #赤いボールが無い時
    print (1)
    for _ in range(1, K):
        print (0)
    exit()

if K == 1: #青いボールが1つのとき
    print (R+1)
    exit()

K_1 = math.factorial(K-1)
R_1 = math.factorial(R+1)
# print (K_1, R_1)
for i in range(1, K+1): #K回答えを出力
    # if i > R:
    #     print (0)
    #     continue
    if i == 1:
        print (R + 1)
        continue
    # print (K_1, R_1, math.factorial(i))
    if i == 2:
        position = R_1//(math.factorial(i) * math.factorial(R + 1- i))
        boal = K_1//(math.factorial(i-1) * math.factorial(K - i))
    if i > 2:
        position = (position * (R + 1 - (i-1))) // i
        boal = (boal * (K - (i-1)))// (i-1)
    print ((position * boal)%(7 + 10 ** 9))
N = int(input())
nums = [input(), for i in range(N)]
print(len(set(nums)))


### FIXED CODE ###

N = int(input())
nums = [input() for i in range(N)]
print(len(set(nums)))
X=input("")
Y=input("")
Z=input("")
if 1<=X<=100and 1<=Y<=100 and 1<=Z<=100 :
  print(Y, X, Z)
  print(Z, Y, x)

### FIXED CODE ###

A,B,C=map(int,input().split())
print(C,A,B)
# -*- coding: utf-8 -*-
n = int(input())
s = list()
counter = {
    'ab': 0,
    'begin_b': 0,
    'end_a': 0,
    'b_to_a': 0
}

for i in range(n):
    substr = input()
    counter['ab'] += substr.count('AB')
    if substr.startswith('B'):
        if substr.endswith('A'):
            counter['b_to_a'] += 1
        else:
            counter['begin_b'] += 1
    else:
        if substr.endswith('A'):
            counter['end_a'] += 1

total = counter['ab'] + min(counter['begin_b'], counter['end_a'])
if counter['b_to_a'] > 0:
    total += (counter['b_to_a'] - 1)
    if max(counter['begin_b'], counter['end_a']) > 0:
        total += 1

print(total)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())

divisors = []
for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
            divisors.append(n // i)

total = 0
for divisor in divisors:
    if divisor == 1:
        continue
    fav = divisor - 1
    x = n // fav
    y = n % fav
    if x == y:
        total += fav

print(total)
N = int(input())
H = list(map(int,input().split()))
state = 0
L = []
cnt = 0
cnt2 = 0
for i in range(1,len(H)):
    d = H[i]-H[i-1]
    if d<0:
        H[i-1] = H[i-1] - 1
for i in range(1,len(H)):
    d = H[i]-H[i-1]
    if d<0:
        cnt+=1
    elif d == 0:
        cnt2+=1

if cnt>0:
    print("No")
elif cnt2 == len(H)-1 and len(H)>=2:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

A,B,C = map(int,input().split())
last = A-B
D = C - last
if D<0:
    D = 0
print(D)
a,b = map(int, input().split())
print("a "+("==" if a == b else "<" if a < b else ">")+" b")


### FIXED CODE ###

x=input().split()

a, b, c = int(x[0]), int(x[1]), int(x[2])

if a<b<c:
    print("Yes")
else:
    print("No")
def is_left_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i < 0:
      return True
    if i >= N:
      return False
  return False
def is_right_removed(i, S, td):
  direction = {'L': -1, 'R': +1}
  for t, d in td:
    if S[i] == t:
      i += direction[d]
    if i >= N:
      return True
    if i < 0:
      return False
  return False

N, Q = map(int, raw_input().split())
s = raw_input()
td = [raw_input().split() for _ in range(Q)]

# left
l = 0
r = N - 1
l_res = -1
while (l <= r):
  target = (r + l) / 2
  if is_left_removed(target, s, td):
    l = target + 1
    l_res = target
  else:
    r = target - 1

# right
l = 0
r = N - 1
r_res = N
while (l <= r):
  target = (r + l) / 2
  if is_right_removed(target, s, td):
    r = target - 1
    r_res = target
  else:
    l = target + 1

print N - min(N, l_res + 1 + N - r_res)

### FIXED CODE ###

A, B, C = map(int, raw_input().split())
if A == B and B == C:
  print 'Yes'
else:
  print 'No'
x = int(X)
a = int(A)

if x < a:
    print(0)

elif a <= x:
    print(10)

### FIXED CODE ###

c = input()
l = c.split()

x = int(l[0])
a = int(l[1])

if x < a:
    print(0)

elif a <= x:
    print(10)
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
if m <= n:
  print(0)
  exit()

if n%2 == 0:
  cutl = n//2 - 1
  cutr = len(x)+1-(n//2)
else:
  cutl = (n//2)
  cutr = len(x)-1+(n//2)

lis = x[cutl:cutr]
l = []

for i in range(len(lis)-1):
  l.append(abs(lis[i] - lis[i+1]))

print(lis[-1] - lis[0] -max(l))


### FIXED CODE ###

n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
if m <= n:
  print(0)
  exit()

l = []

for i in range(len(x)-1):
  l.append(x[i+1] - x[i])
  
l.sort(reverse = True)

for i in range(n-1):
  l[i] = 0
  
print(sum(l))
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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 LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,k = map(int,input().split())
    if n%k == 0:
      print(0)
    else:
      print(math.gcd(n,k))
    
    return

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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 LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,k = map(int,input().split())
    print(min(n%k,-n%k))
    return

#Solve
if __name__ == "__main__":
    solve()
import sys
for e in sys.stdin:
 a,b,n=map(int,e.split())
 print(sum(int(i)for i in str(a/b)[2:][:n]))


### FIXED CODE ###

import sys
for e in sys.stdin:
 a,b,n=map(int,e.split())
 print(sum(a*10**i//b%10 for i in range(1,n+1)))
#!/usr/bin/env python3



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    St = list(input())
    T = input()

    # print(len(T))
    f = False
    for i in range(len(St)):
        if(St[i] == T[0]):
            cnt = 0
            for j in range(len(T)):
                if(T[j] == St[i+j] or St[i+j] == '?'):
                    # if(cnt == len(T)-1):
                    #     St[i:i+j] = T[j]
                    continue
                else:
                    break
            if(cnt == len(T[j])-1):
                for j in range(len(T)):
                    St[i+j] = T[j]
                f = True
    # print(St)
    if(f):
        print(''.join(St).replace('?', 'a'))
    else:
        print('UNRESTORABLE')
    
    
if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    S = input().replace('?', '.')
    T = input()

    import re
    import sys

    for i in range(len(S)-len(T),-1,-1):
        if(re.match(S[i:i+len(T)],T)):
            S = S.replace('.', 'a')
            print(S[:i]+T+S[i+len(T):])
            exit()
    else:
        print("UNRESTORABLE")
    
if __name__ == '__main__':
    main()
a, b, c = map(int, input().split())

print("Yes" if a <= c <= b else "No)

### FIXED CODE ###

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

print("Yes" if a <= c <= b else "No")
N,M = map(int, input().split())

for i in range(int(M**0.5), 1, -1):
    if M % i != 0:
        continue
    if M//i >= N:
        break

print(i)


### FIXED CODE ###

N,M = map(int, input().split())

maxi = 1
for i in range(int(M**0.5), 0, -1):
    if M % i != 0:
        continue
    if M//i >= N:
        maxi = max(maxi, i)
    if i >= N:
        maxi = max(maxi, M//i)

print(maxi)
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = IS()
	T = IS()
	ans = 0
	for i in range(3):
		if(S[i]==T(i)):
			ans+=1
	print(ans)

if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = IS()
	T = IS()
	ans = 0
	for i in range(3):
		if(S[i]==T[i]):
			ans+=1
	print(ans)

if __name__ == '__main__':
	main()
N,X = map(int,input().split())
for i in range(max(−1000000,X-N+1),max(X+N,1000001)):
    print(i)

### FIXED CODE ###

N,X = map(int,input().split())
for i in range(max(-1000000,X-N+1),min(X+N,1000001)):
    print(i)
def totalcost(i,cost,N):
  if i>=N:
    return 0
  option1 = abs(cost[i]-cost[i+1]) + totalcost(i+1,cost,N)
  ans = option1
  if i+2<=N:
    option2 = abs(cost[i]-cost[i+2]) + totalcost(i+2,cost,N)
    ans = min(option2,ans)
  return ans

n = int(input())
cost = list(map(int,input().split()))
cost = [0]+cost
print(totalcost(1,cost,n))

### FIXED CODE ###

def totalcost_recur(i,cost,N,lookup):
  if i>=N:
    return 0
  if i in lookup:
      return lookup[i]
  option1 = abs(cost[i]-cost[i+1]) + totalcost_recur(i+1,cost,N,lookup)
  ans = option1
  if i+2<=N:
    option2 = abs(cost[i]-cost[i+2]) + totalcost_recur(i+2,cost,N,lookup)
    ans = min(option2,ans)
  lookup[i] = ans
  return ans



def totalcost_dp(cost,N):
    dp = [0]*(N+1)
    dp[1] = 0
    dp[2] = abs(cost[2]-cost[1])
    i = 3
    while i<=N:
        option1 = dp[i-1]+abs(cost[i]-cost[i-1])
        option2 = dp[i-2]+abs(cost[i]-cost[i-2])
        dp[i] = min(option1,option2)
        i+=1

    return dp[N]


n = int(input())
cost = list(map(int,input().split()))
cost = [0]+cost
lookup = {}

print(totalcost_dp(cost,n))
n=list(input())

if (n[3]==n[4]):
    pass
    if (n[5]==n[6]):
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

n=list(input())

if n[2]==n[3] and n[4]==n[5]:
    print("Yes")
else:
    print("No")
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
s=0
for i in range(n):
  if i==0:
    s+=b[a[0]]
  elif a[i]==a[i-1]+1:
    s=s+b[a[i]-1]+c[a[i]-2]
  else:
    s=s+b[a[i]]
print(s)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
s=0
for i in range(n):
  if i==0:
    s+=b[a[0]-1]
  elif a[i]==a[i-1]+1:
    s=s+b[a[i]-1]+c[a[i]-2]
  else:
    s=s+b[a[i]-1]
print(s)
class unionFind():
	def __init__(self,n):
		self.tree=[-1]*n
	def find(self,x):
		if self.tree[x]<0:
			return x
		else:
       		self.tree[x]=self.find(self.tree[x])
			return self.tree[x]
	def union(self,x,y):
		xr=self.find(x)
		yr=self.find(y)
		if xr!=yr:
			if self.tree[xr]<self.tree[yr]:
				self.tree[yr]=xr
			elif self.tree[xr]>self.tree[yr]:
				self.tree[xr]=yr
			else:
				self.tree[xr]-=1
				self.tree[yr]=xr
			return True
		
		return False
def main():
	ans=0
	n,m=map(int,input().split())
	a=unionFind(n)
	li=[x-1 for x in list(map(int,input().split()))]
	for _ in range(m):
		x,y=map(int,input().split())
		a.union(x-1,y-1)
	for x in range(n):
		ans += a.find(x)==a.find(li[x])
	return ans
print(main())


### FIXED CODE ###

from collections import defaultdict
import sys
sdin = sys.stdin.readline

class UnionFind:
    def __init__(self, node:int) -> None:
        self.n = node
        self.par = [i for i in range(self.n)]
        self.rank = [0 for i in range(self.n)]
        
    def find(self, x:int) -> int:
        if x == self.par[x]:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
        
    def unite(self, x:int, y:int) -> bool:
        if self.isSame(x,y):
            #print("x and y has already united")
            return False
        
        rx = self.find(x)
        ry = self.find(y)
        
        if self.rank[rx] < self.rank[ry]:
            self.par[rx] = ry
        else:
            self.par[ry] = rx
            
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1
                
        return True
    
    def isSame(self, x:int, y:int) -> bool:
        return self.find(x) == self.find(y)

    

        
N, M = map(int, sdin().split())
P = list(map(int, sdin().split()))
XY = []
for i in range(M):
    XY.append(list(map(int, sdin().split())))


root_node = defaultdict(list)

uf = UnionFind(N)
for x,y in XY:
    x -= 1
    y -= 1
    uf.unite(x,y)

for i in range(N):
    uf.find(i)
    
par = uf.par

for i,root in enumerate(par):
    root_node[root].append(i)
    
ans = 0
for node_list in root_node.values():
    num_list = []
    for i in node_list:
        num_list.append(P[i]-1)
    
    ans += len(set(node_list)&set(num_list))
            
print(ans)
x,y,z=map(int,(input.split())
print(str(y)+" "+str(z)+" "+str(x))

### FIXED CODE ###

x,y,z=map(int,input().split())
print(str(z)+" "+str(x)+" "+str(y))
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial



def union_r(node):
    global road_union
    if road_union[node] != node:
        road_union[node] = union_r(road_union[node])
    return road_union[node]

def union_t(node):
    global train_union
    if train_union[node] != node:
        train_union[node] = union_t(train_union[node])
    return train_union[node]


road_union, train_union = [], []


def main():
    node_num, road_num, train_num = map(int, input().split())

    global road_union
    road_union = [i for i in range(node_num + 1)]
    for i in range(road_num):
        a, b = map(int, input().split())
        parent_a = union_r(a)
        parent_b = union_r(b)
        road_union[min(parent_a, parent_b)] = max(parent_a, parent_b)
        # print(road_union)

    global train_union
    train_union = [i for i in range(node_num + 1)]
    for i in range(train_num):
        a, b = map(int, input().split())
        parent_a = union_t(a)
        parent_b = union_t(b)
        train_union[min(parent_a, parent_b)] = max(parent_a, parent_b)

    # print(train_union, road_union)

    ryouhou = [0 for i in range(node_num + 1)]
    for i in range(1, node_num + 1):
        parent_r = union_r(i)
        parent_t = union_t(i)
        ryouhou[i] = (parent_r, parent_t)

    # print(train_union, road_union, 'uuu')

    count_d = Counter(ryouhou)

    for i in range(1, node_num + 1):
        now_flg = ryouhou[i]
        print(count_d[now_flg], end=' ')
    print()





if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial



def main():
    if input() in ['a', 'e', 'i', 'o', 'u']:
        print('vowel')
    else:
        print('consonant')






if __name__ == '__main__':
    main()
N = int(input())
S = input()
 
count[0] = S.count('.')
for i in range(1, len(S)+1):
    count[i] = count[i-1] + (1 if S[i-1]=='#' else 0) - (1 if S[i-1]=='.' else 0)

print(min(count))

### FIXED CODE ###

N = int(input())
S = input()

count = [0]*(len(S)+1)
count[0] = S.count('.')
for i in range(1, len(S)+1):
    count[i] = count[i-1] + (1 if S[i-1]=='#' else 0) - (1 if S[i-1]=='.' else 0)

print(min(count))
x,a = map(int,input().split())
if x >= a:
  print(10)
else:
  priny(0)

### FIXED CODE ###

x,a = map(int,input().split())
if x >= a:
  print(10)
else:
  print(0)
N = input()
print (["No","Yes"][N[0] == N[2])

### FIXED CODE ###

N = input()
print (["No","Yes"][N[0] == N[2]])
n = int(input())
xl = []
for i in range(n):
    x1, l1 = map(int, input().split())
    xl.append([x1, x1 + l1, 2 * l1])
xl.sort()
ans = n
for i in range(n - 1):
    if xl[i][1] > xl[i + 1][0]:
        if xl[i][2] >= xl[i + 1][2]:
            ans -= 1
        else:
            ans -= 1
            xl[i + 1][0] = [i][0]
            xl[i + 1][1] = [i][1]
            xl[i + 1][2] = [i][2]

print(ans)

### FIXED CODE ###

n = int(input())
st = []
for i in range(n):
    x, l = map(int, input().split())
    st.append([x + l, x - l])

st.sort()
cnt = 1
right = st[0][0]
for i in range(1, n):
    if right <= st[i][1]:
        right = st[i][0]
        cnt += 1

print(cnt)
MOD = 10 ** 9 + 7

def solve(N, K, A):
    A.sort()
    ans = 0
 
    for i in range(1, N):
        now = comb(i, K - 1, MOD)
        ans += A[i] * now
 
    A.sort(reverse=True)
    for i in range(1, N):
        now = comb(i, K - 1, MOD)
        ans += A[i] * (-now)
 
    return ans % MOD
 
 
# N = int(input())
# S = input()
N, K = map(int, input().split())
A = list(map(int, input().split()))

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)


print(solve(N, K, A))

### FIXED CODE ###

MOD = 10 ** 9 + 7

def solve(N, K, A):
    A.sort()
    ans = 0
 
    for i in range(1, N):
        now = cmb(i, K - 1, MOD)
        ans += A[i] * now
 
    A.sort(reverse=True)
    for i in range(1, N):
        now = cmb(i, K - 1, MOD)
        ans += A[i] * (-now)
 
    return ans % MOD
 
 
# N = int(input())
# S = input()
N, K = map(int, input().split())
A = list(map(int, input().split()))

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)


print(solve(N, K, A))
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    print(T)

ans = lcm(T[0] , T[1])
for i in range(2 , N):
    ans = lcm(T[i] , ans)
print(ans)

### FIXED CODE ###

import math


def lcm(a, b):
    return a * b // math.gcd(a, b)


N = int(input())
ans = int(input())
for _ in range(N - 1):
    ans = lcm(ans, int(input()))
print(ans)
import sys
inputs = sys.stdin.readlines()

h, w, k = map(int, inputs[0].split())
r = iter(range(1, k+1))
A = [list(map(lambda y: 0 if y == '.' else next(r), x)) for x in inputs[1:]]
B = np.array(A)

def f(x, y, val, dx0, dx1, dy0, dy1, search=True):
    if search and 0 <= x+dx0-1 < w and B[y, x+dx0-1] == 0:
        B[y, x+dx0-1] = val
        search = f(x, y, val, dx0-1, dx1, dy0, dy1)
    elif search and 0 <= x+dx1+1 < w and B[y, x+dx1+1] == 0:
        B[y, x+dx1+1] = val
        search = f(x, y, val, dx0, dx1+1, dy0, dy1)
    elif search and 0 <= y+dy0-1 < h and np.all(B[y+dy0-1, x+dx0:x+dx1+1] == 0):
        B[y+dy0-1, x+dx0:x+dx1+1] = val
        search = f(x, y, val, dx0, dx1, dy0-1, dy1)
    elif search and 0 <= y+dy1+1 < h and np.all(B[y+dy1+1, x+dx0:x+dx1+1] == 0):
        B[y+dy1+1, x+dx0:x+dx1+1] = val
        search = f(x, y, val, dx0, dx1, dy0, dy1+1)
    return False

traveled = set()
for y in range(h):
    for x in range(w):
        if B[y, x] != 0 and B[y, x] not in traveled:
            dummy = f(x, y, B[y, x], 0, 0, 0, 0)
            traveled.add(B[y, x])
for b in B:
    print(*b)

### FIXED CODE ###

import numpy as np
inputs = open(0).readlines()

def main(inputs):
    h, w, k = map(int, inputs[0].split())
    cake, count, coords = np.zeros((h, w), dtype=np.uint), 0, {}
    for i, s in enumerate(inputs[1:]):
        for j, c in enumerate(s):
            if c == '#':
                count += 1
                cake[i, j] = count
                coords[count] = (j, i)
    empty_rows = {i for i, rows in enumerate(cake) if not np.any(rows)}

    for i in range(1, count+1):
        x, y = coords[i]
        x0, y0 = x-1, y-1
        x1, y1 = x+1, y+1
        while 0 <= x0 and cake[y, x0] == 0:
            cake[y, x0] = i
            x0 -= 1
        x0 += 1
        while x1 < w and cake[y, x1] == 0:
            cake[y, x1] = i
            x1 += 1
        while 0 <= y0 and y0 in empty_rows:
            cake[y0, x0:x1] = i
            y0 -= 1
        while y1 < h and y1 in empty_rows:
            cake[y1, x0:x1] = i
            y1 += 1

    for rows in cake:
        print(*rows)

main(inputs)
N = int(input())

def func(N_max):
#     print(f'N_max:{N_max}')
    cnt = 0
#     flag = False
    ans = []
    
    total = 0

    for x in range(1, N_max):
        x_total = x**2
        if N_max < x_total:
            break
        for y in range(x, N_max):
            y_total = x_total + y**2 + x*y
            if N_max < y_total:
                break

            for z in range(y, N_max):
                total = y_total + z**2+y*z+z*x
                if N_max < total:
                    break
                ans.append((total, change(len(set((x,y,z))))))

    return ans

def change(length):
    if length < 1:
        return 0
    elif length == 1:
        return 1
    elif length == 2:
        return 3
    elif length == 3:
        return 6

data = func(N)
ans_list = [0] * (N)
for d in data:
    ans_list[d[0]-1] = d[1]
for a in ans_list:
    print(a)

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