peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n, m = map(int, input().split())

if n % 2: # odd
    for i in range(m):
        print(i + 1, n - i)
else: # even
    for i in range(m):
        if 1 + 2 * i >= n - 1 - 2 * i:
            break
        m -= 1
        print(i + 1, n - i)
    for i in range(m):
        print(i + 1 + m, n - i - m - 1)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
c = 0
for hoge in a:
  c += hoge
avg = c/2
t = 0
s = 0
while t < avg:
  t += a[s]
  s += 1
ans = min(avg-t,t+a[s]-avg)
print(int(ans*2))
# Judge status: Wrong Answer
N = int(input())
a = input().split()

_max = int(max(a))
_min = int(min(a))
result = 20000 * N

start = _min
end = _max
step = 1

if _min > _max:
  start = _min
  end = _max -1
  step = -1
else:
  start = _min
  end = _max +1
  step = 1

for i in range(start,end,step):
  _result = 0
  for j in a:
    _result += (i - int(j))**2
  if _result <= result:
    result = _result
print(result)
# Judge status: Accepted
n=int(input())
k=int(input())
x=int(input())
y=int(input())
ans =0
for i in range(n):
    if(i+1<=k):
        ans += x
    if(i+1>k):
        ans += y
print(ans)
# Judge status: Wrong Answer
X=int(input())
if X<599:
    k=8
elif 600<=X<=799:
    k=7
elif 800<=X<=999:
    k=6
elif 1000<=X<=1199:
    k=5
elif 1200<=X<=1399:
    k=4
elif 1400<=X<=1599:
    k=3
elif 1600<=X<=1799:
    k=2
else:
    k=1
print(k)
# Judge status: Accepted
n, c, k = map(int, input().split())
T = sorted([int(input()) for _ in range(n)])

out = T.pop(0) + k
peo = 1
bus = 1

for t in T:
    if t <= out and peo < c:
        peo += 1

    else:
        out = t + k
        peo = 1
        bus += 1

print(bus)
# Judge status: Accepted
a=int(input())
b=int(input())
h=int(input())
print(int(((a+b)*h)/2))
# Judge status: Accepted
from math import gcd

k = int(input())

cnt = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            cnt += gcd(gcd(i, j), k)

print(cnt)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())
a = list(map(int, input().split()))

s = sum(a)
half = s / 2

cum = 0
for v in a:
    if abs(half - cum) < abs(half - (cum + v)):
        break
    cum += v
print(abs((s - cum) - cum))
# Judge status: Accepted
import math
a, b, x = map(int, input().split())
if a ** 2 * b <= 2 * x:
    tan = 2 * (a **2 * b - x) / (a ** 3)
else:
    tan = a * b ** 2 / (2 * x)
print(math.degrees(math.atan(tan)))
# Judge status: Accepted
lst = list(map(int, input().split('/')))
if lst[1] >= 5:
    print('TBD')
else:
    print('Heisei')
# Judge status: Wrong Answer
h, a = (int(i) for i in input().split())
print((h//a)+1)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
d4 = 0
d2 = 0
d1 = 0
for a in A:
    if a%4 == 0:
        d4 += 1
    elif a%2 == 0:
        d2 += 1
    else:
        d1 += 1
if d4 >= d1:
    print('Yes')
elif d4+1 == d1 and d2%2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A, B, C = map(int, input().split())

K = int(input())

rest = K
while A >= B and rest > 0:
    B *= 2
    rest -= 1
while B >= C and rest > 0:
    C *= 2
    rest -= 1

if rest >= 0 and A < B and B < C:
    print("Yes")
else:
    print("No")
# Judge status: Accepted

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

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

N = int(input())
a = int(N ** .5)

for num in range(a):
    num = a - num
    if N % num == 0:
        b = N // num
        # print(b, num)
        print(b + num -2)
        sys.exit()
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
ans = 'U' * (ty - sy)
ans += 'R' * (tx - sx)
ans += 'D' * (ty - sy)
ans += 'L' * (tx - sx + 1)
ans += 'U' * (ty - sy + 1)
ans += 'R' * (tx - sx + 1)
ans += 'D'
ans += 'R'
ans += 'D' * (ty - sy + 1)
ans += 'L' * (tx - sx + 1)
ans += 'U'
print(ans)
# Judge status: Accepted
n = int(input())
l = [2, 1]

for i in range(2, n + 1):
    l.append(l[i - 2] + l[i - 1])

print(l[n])
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

M=A[0]
ans = 0
for i in range(1,N):
    if A[i]<M:
        ans += M - A[i]
    else:
        M = A[i]

print(ans)
# Judge status: Wrong Answer
N,M = map(int,input().split())
a = [1]+[0]*(N-1)
b = [1]*N
sts = 0

for i in range(M):
  x,y = map(int,input().split())

  if x ==1 and sts == 0:
    a[x-1]=0
    a[y-1]=1
    sts+=1
  elif a[x-1]==1 and b[x-1]==1:
    a[x-1]=0
    a[y-1]=1
  elif a[x-1]==1:
    a[y-1]=1
  b[x-1]-=1
  b[y-1]+=1
    
print(sum(a))
# Judge status: Accepted
# D - Dice in Line
from itertools import accumulate #累積和
n,k,*p = map(int,open(0).read().split())
ac = [0] + list(accumulate(p))
a = 0
for i in range(n-k+1): a = max(a, ac[i+k] - ac[i])
print((a+k)/2)
# Judge status: Accepted
a = list(map(int, input().split()))
print(a[0]*a[1])
# Judge status: Wrong Answer
a =int(input())
 
ans = a+a**2+2**3
print(ans)
# Judge status: Accepted
def Atcoder_Crackers(n , k):

    return 0 if n % k == 0 else 1

def main():
    n , k = map(int , input().split())
    print(Atcoder_Crackers(n , k))

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c=map(int,input().split())
k=a+b+c
print(k-max(max(a,b),c))
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

s = input()

if len(set(s))%2 == 1:
    print("No")
    exit()
if s.count('N')%2==s.count('S')%2 or s.count('W')%2==s.count('E')%2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
X, K, D = map(int, input().split())

X = abs(X)
reach_or_before = X // D


if K <= reach_or_before:
    print(X - D * K)
else:
    #remaining jump
    remain = K - reach_or_before
    before_dist = X - D * reach_or_before #(>0)
    after_dist = D * (reach_or_before + 1) - X
    if remain % 2 == 0:
        print(before_dist)
    else:
        print(after_dist)
# Judge status: Accepted
a,b,c=map(int, input().split())

m=b//a

if m>=c:
  print(c)
else:
  print(m)
# Judge status: Wrong Answer
def main():
    A, B, C, D = input()
    op = ['+', '+', '+']
    for i in range(2**3):
        for j in range(len(op)):
            if (i >> j) & 1:
                op[j] = '-'
        if eval(A + op[0] + B + op[1] + C + op[2] + D) == 7:
            print(A + op[0] + B + op[1] + C + op[2] + D + '=7')
            break
if __name__  == '__main__':
    main()
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l.sort(key=lambda x:x[0])
cnt=0
ans=0
num=0
while cnt<m:
  for i in range(n):
    cnt+=l[i][1]
    ans+=l[i][0]*l[i][1]
    num+=1
print(ans+(m-cnt)*l[num-1][0])
# Judge status: Wrong Answer
A, B, C = map(int, input().split())

if C % 2 == 0:
    print(0)
else:
    red = (C//2+1) * A * B
    blue = (C//2) * A * B
    print(red - blue)
# Judge status: Accepted
s = input()
if len(s) == len(set(s)):
    print('yes')
else:
    print('no')
# Judge status: Accepted
import bisect

N = int(input())
L = [int(x) for x in input().split()]
L.sort()
ret = 0
# print(L)
for i in range(N-2):
    for j in range(i+1, N-1):
        add = bisect.bisect_left(L,L[i]+L[j]-0.01) - (j+1)
        # print(f"{L[i]}, {L[j]} , add:{add}")
        ret += add

print(ret)
# Judge status: Accepted
import math
a,b=map(int,input().split())
ans=math.ceil((a+b)/2)
print(ans)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

a, b, x = nm()
d_min = x - (a % x)
if d_min == x: 
    d_min = 0
d_max = b % x
min = a + d_min
max = b - d_max
if min > max: 
    ans = 0
else:
    ans = ((max - min) // x + 1)
print(ans)
# Judge status: Accepted
import numpy as np
from itertools import product
N,M,X = list(map(int, input().split()))
C = [0] * N
A = []

for i in range(N):
  wk = list(map(int, input().split()))
  C[i] = wk[0]
  A.append(wk[1:])

C = np.array(C)
A = np.array(A)

ans = -1
for pt in product([0,1], repeat = N):
  p = np.array(pt)  
  #print(C.dot(p))
  #print(p.dot(A))
  rikai = p.dot(A)
  if min(rikai) >= X:
    ans = C.dot(p) if ans == -1 else min(ans, C.dot(p))
  
print(ans)
# Judge status: Wrong Answer
#DP カエルの奴 A 　配るDP
N=int(input())
S=list(map(int,input().split()))
S.append(100010)
DP=[100000000]*100010

DP[0]=0
for i in range(N-1):
    if DP[i]+abs(S[i]-S[i+1])<DP[i+1]:
        DP[i+1]=DP[i]+abs(S[i]-S[i+1])
    if DP[i]+abs(S[i]-S[i+2])<DP[i+2]:
        DP[i+2]=DP[i]+abs(S[i]-S[i+2])


print(DP[N-1])
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7

def resolve():
    n = int(input())
    if n % 2 != 0:
        print(0)
        exit()
    L = n // 2
    res = 0
    while L:
        res += L // 5
        L //= 5
    print(res)

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
import collections
alpha=['a','b','c','d','e','f','g','h','i','j']
def a(n):
  if n==1:
    return ['a']
  else:
    box=[]
    alphan=alpha[:n+1]
    for i in a(n-1):
      kind=collections.Counter(i)
      for j in range(len(kind)+1):
        box.append(i+alpha[j])
  return box
for i in a(int(input())):
  print(i)
# Judge status: Wrong Answer
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
tmpl = 50-10**5*0.006
lst = list()
for i in range(N):
    tmp = T-H[i]*0.006 
    tmpl= abs(T-tmp)
    lst.append((tmpl,i+1))
lst.sort()
for k,j in lst:
    print(j)
    break
# Judge status: Accepted
import collections

x, y = map(int,input().split())
li = list(map(int,input().split()))
c = collections.Counter(li)
ans = 0

count = c.most_common()
if len(count) > y:
    for i in range(y,len(count)):
        ans += count[i][1]

print(ans)
# Judge status: Accepted
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, k = map(int, readline().split())
p = list(map(int, readline().split()))

l = [i for i in range(1, 1001)]
av = np.cumsum(l) / l

tmp = [av[i - 1] for i in p]
cs = list(np.cumsum(tmp))

if n == k:
    print(cs[-1])
    exit()
ans = 0
for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i])
print(ans)
# Judge status: Wrong Answer
print( 'Yes' if input() == '30' else 'No')
# Judge status: Accepted
import sys
from math import atan, pi

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    a, b, x = map(int, readline().split())
    if x > a * a * b / 2:
        angle = atan(2 * (a * a * b - x) / a ** 3)
    else:
        angle = atan(a * b * b / (2 * x))

    print(angle / pi * 180)
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
import numpy as np
n = int(input())
hikumono = n * (n-1)//2
A = np.array(list(map(int, input().split())))
B = np.array([i+1 for i in range(n)])
C=A-B
heikin1 = int(np.median(C))
heikin2 = heikin1 + 1
heikin3 = heikin1 - 1
ans1 = abs(C-heikin1).sum()
ans2 = abs(C-heikin2).sum()
ans3 = abs(C-heikin3).sum()
print(min(ans1, ans2, ans3))
# Judge status: Accepted
n,k=map(int,input().split())
p=list(map(int,input().split()))
e=[]
for pp in p:
    ex=(pp+1)/2
    e.append(ex)
ans=0
for i in range(n-k+1):
    if i==0:
        t=sum(e[:k])
        ans+=t
        continue
    t-=e[i-1]
    t+=e[i+k-1]
    ans=max(ans,t)

print(ans)
# Judge status: Accepted
inputlist = list(map(int, input().split()))
snum = inputlist[0]
kindofsweets = inputlist[1]
setofkind = []
for i in range(kindofsweets):
    input()
    setofkind += (list(map(int, input().split())))
counter = 0
for i in range(snum):
    if i + 1 not in setofkind:
        counter += 1
print(counter)
# Judge status: Accepted
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x_max = max(x)
z = min(y)

if X < z <= Y and x_max < z:
  print('No War')
else:
  print('War')
# Judge status: Accepted
n,m=map(int,input().split())
A,B,C,D=[],[],[],[]
for i in range(n):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
for i in range(m):
    c,d=map(int,input().split())
    C.append(c)
    D.append(d)
for i in range(n):
    ans,x=1000000000000,0
    for j in range(m):
        if ans>abs(A[i]-C[j])+abs(B[i]-D[j]):
            ans=abs(A[i]-C[j])+abs(B[i]-D[j])
            x=j
    print(x+1)
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))

d = []
for key,value in Counter(A).items():
    if value >=4 :
        d.append(key)
        d.append(key)
    if value >= 2:
        d.append(key)

if len(d) < 2:
    print(0)
else:
    d = sorted(d,reverse=True)
    x = d[0]
    y = d[1]

    print(x*y)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split())) 
b = 0
if k<=n:
  for i in range(k):
    b = a[b]-1
  print(b+1)
  exit(0)
c = [0]
for i in range(n):
  b = a[b]-1
  c.append(b)
d = c[:-1].index(c[-1])
c = c[d:-1]
k = k-d
print(c[k%len(c)]+1)
# Judge status: Accepted
X = int(input())
k = 1
while True:
    cand = X*k
    if cand%360==0:
        break
    k+=1
print(k)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())

if A % B == 0 and C!=0:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
Q,H,S,D = map(int,input().split())
N = float(input())

ans = 0

while N > 0:
  div = N // 2
  if N >= 2:
    #print(N,div)
    ans += min(8 * Q,4 * H,2 * S ,D) * div
    N = N % 2 
  else:
    #print(N)
    if N >= 1:
      ans += min(4 * Q,2 * H,S)
      N -= 1
    elif N >= 0.5:
      ans += min(2 * Q,H)
      N -= 0.5
    else:
      ans += Q
      N -= 0.25
    
print(int(ans))
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[]
    for i in range(1,33):
        for j in range(2,11):
            l.append(i**j)
    l.sort()
    print(l[bisect_right(l,X)-1])

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

D = {}
for i in range(1, n+1):
    D[A[i-1]] = i

for k, v in sorted(D.items()):
    print(v, end=" ")
# Judge status: Wrong Answer
#! /usr/bin/env python3

from fractions import gcd
# from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement

ans = lambda x : x % 998244353

N = int(input())
D = [int(_) for _ in input().split()]

c = Counter(D)

bef = 1
ret = 1 * (not D[0])

for i in range(len(c)):
    if c[i] == 0:
        ret = 0
    ret *= bef ** c[i]
    bef = c[i]

print(ret)
# Judge status: Accepted
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    n = str(input())

    #output
    l = len(n)

    mod = 0
    for i in range(l):
        mod += int(n[i])
        mod %= 9 

    #  %%
    if mod == 0:
        print("Yes")
    else:
        print("No")

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()
# Judge status: Accepted
N=int(input())
n=0
for i in range(1,N+1):
    list1=list(str(i))
    #print(list1)
    #print(len(list1))
    if len(list1)%2 != 0:
        n+=1
print(n)
# Judge status: Accepted
def resolve():
    n, m = map(int, input().split())
    if n % 2 == 0:
        x = (m + 1) // 2
        for i in range(x):
            print(x - i, x + i + 1)
        x = m // 2
        for i in range(x):
            print(n - (x - i - 1), n - (x + i + 1))
    else:
        for i in range(m):
            print(i + 1, n - i)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
n=int(input())

a= pow(10,n,10**9+7)
b = pow(8,n,10**9+7)
c = pow(9,n,10**9+7)

print((a-2*c+b)%(10**9+7))
# Judge status: Accepted
x, y = map(int, input().split())  
cnt = 1
while x *2 <= y:
    #print(x*2)
    cnt+=1
    x=x*2
print(cnt)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = [int(i) for i in input().split()]
a = sorted(list(set(a)))
from fractions import gcd
lc = a[0]
if n != 1:
  for num,i in enumerate(a[1:]):
    if lc == 0:
      break
    lc = lc * i // gcd(lc, i)
    if gcd(lc, i) == min(i,lc):
      for j in a[:num]:
        if (i//j)%2 == 0:
          lc = 0
          break 
if lc == 0:
  print(0)
else:
  print((m+lc//2)//lc)
# Judge status: Wrong Answer
S = input().strip()
cnt0 = 0
cnt1 = 1
for i in range(len(S)):
    if S[i]=="0":
        cnt0 += 1
    else:
        cnt1 += 1
print(min(cnt0,cnt1)*2)
# Judge status: Accepted
s = input()
if len(s) == 1: print(int(s[0]))
elif s[1:] == "9"*(len(s)-1):
  print(int(s[0])+9*len(s)-9)
else: 
  print(int(s[0])+9*len(s)-10)
# Judge status: Accepted
N, K = map(int, input().split())
S = list(input())
S[K - 1] = S[K - 1].lower()
print("".join(S))
# Judge status: Accepted
import sys
import math
import bisect
 
def main():
    A = list(map(int, input().split()))
    print(len(set(A)))
 
if __name__ == "__main__":
    main()
# Judge status: Accepted
# coding: utf-8
# Your code here!
S=int(input())
List=[S]

i=1
while 1==1:
    i+=1
    if S%2==0:
        S=S/2
    else:
        S=(S*3)+1
    List.append(S)
    
    if len(List) != len(set(List)):
        break
    #i+=1
    
print(i)
# Judge status: Wrong Answer
A, B = map(int, input().split())
print(A + B // 2 if (A + B) % 2 == 0 else "IMPOSSIBLE")
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
print(int(n / max(h,w)))
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a<9 & b<9:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
def c(x):
    cnt=0
    for i in a:
        cnt += i // x
    return cnt<=k
l, r = 0, max(a)
for i in range(100):
    mid = (l + r) / 2
    if c(mid):
        r = mid
    else:
        l = mid
print(ceil(l))
# Judge status: Accepted
h1, m1, h2, m2, k = list(map(int, input().split()))

result = (h2 * 60 + m2) - (h1 * 60 + m1) - k
print(result)
# Judge status: Accepted
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

d = Counter(A)

sub_s = sum(A)

for b, c in BC:
    sub_s += d[b] * (c - b)
    d[c] += d[b]
    d[b] = 0

    print(sub_s)
# Judge status: Accepted
N = input()
if N[1:] == (len(N)-1)*'9':
    print(int(N[0]) + (len(N)-1)*9)
else:
    print((int(N[0])-1) + (len(N)-1)*9)
# Judge status: Accepted
from collections import deque

N, M = map(int, input().split())
graph = [[] for i in range(N+1)]
for i in range(M):
  a, b = map(int, input().split())
  graph[a].append(b); graph[b].append(a)

d = deque([[1, 0]])
par = [0] * (N+1)
while d:
  node, p = d.popleft()
  children = graph[node]
  for child in children:
    if child == p or par[child] != 0:
      continue
    par[child] = node
    d.append([child, node])

print('Yes')
print(*par[2:], sep='\n')
# Judge status: Accepted
import itertools
n = int(input())
data = list(map(int, input().split()))
data1=sorted(data)
a = list(itertools.combinations(data1,3))
ans=0
for m in range(len(a)):
  if a[m][0]!=a[m][1] and a[m][1]!=a[m][2]:
    if a[m][0]+a[m][1]>a[m][2]:
      ans=ans+1
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
print(max([0,c-a+b]))
# Judge status: Accepted
import sys
def input():
  return sys.stdin.readline()[:-1]
h, n = map(int, input().split())
a=[0]*n
b=[0]*n
for i in range(n):
  a[i], b[i] = map(int, input().split())

dp = [float('inf')]*(h+max(a))
dp[0] = 0 
for i in range(1, h+max(a)):
  for j in range(n):
    dp[i] = min(dp[i], dp[i-a[j]]+b[j])
print(min(dp[h:]))
# Judge status: Accepted
x,y,z = map(int,input().split())
x=x-z
print(x//(y+z))
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
count=0
for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      if 500*i+100*j+50*k==x:
        count+=1
print(count)
# Judge status: Accepted
N,A,B= map(int,input().split())
if (B-A)%2 == 0:
  print((B-A)//2)
else:
  print(min(A-1,N-B)+1+(B-A-1)//2)
# Judge status: Accepted
N, X, Y = map(int, input().split())
d = [[0] * (N+1) for _ in range(N)]
ans = [0] * N 

for i in range(1, N+1):
  for j in range(i+1, N+1):
    a = j - i
    b = 1 + abs(i - X) + abs(j - Y) 
    d[i][j] = min(a, b)
    ans[d[i][j]] += 1

for i in range(1, N):
  print(ans[i])
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = [None]*n
for i in range(n, 0, -1):
    s = 0
    for j in range(2*i, n+1, i):
        s += b[j-1]
    b[i-1] = a[i-1]^(s%2)
print(sum(b))
print(*[ind+1 for ind, i in enumerate(b) if i])
# Judge status: Accepted
n = int(input())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
cc = list(map(int, input().split()))
score = bb[aa[0]-1]
for i in range(1,n):
    score += bb[aa[i]-1]
    if aa[i] == aa[i-1] +1:
        score += cc[aa[i-1]-1]
print(score)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

print('Yes' if a <= c and c <= b else "No")
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.buffer.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

n = ri()
for i in range(int(n**0.5), 0, -1):
    if not n%i:
        print(n//i + i - 2)
        exit()
# Judge status: Wrong Answer
import math
A, B, H, M = map(int,input().split())
degunit1 = 360/720
degunit2 = 360/60
currentHM = 60*H+M
deg1 = degunit1*currentHM
deg2 = degunit2*M
diff = abs(deg1-deg2)
if diff <=180:
  diff = diff*math.pi/180
else:
  diff = (diff-180)*math.pi/180
L = (A**2+B**2 -2*A*B*math.cos(diff))**0.5
print(L)
# Judge status: Accepted
N = int(input())
S = input()

left = 0
for i in range(N - 1, -1, -1):
    if S[i] == ")":
        left += 1
    else:
        left = max(0, left - 1)

right = 0
for i in range(N):
    if S[i] == "(":
        right += 1
    else:
        right = max(0, right - 1)

print("(" * left + S + ")" * right)
# Judge status: Wrong Answer
# https://atcoder.jp/contests/abc119/tasks/abc119_a
y, m, d = map(int, input().split('/'))
if y > 2019:
    print('TBD')
elif m > 5:
    print('TBD')
else:
    print('Heisei')
# Judge status: Wrong Answer
arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]


if b - a <= d and c - b <= d:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s=input().replace('eraser',"").replace('eraser',"").replace('erase',"").replace('dreamer',"").replace('dream',"")
if s:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
def dfs(A: list):
    if len(A) > nn:
        return
    if len(A) and (x := int("".join(A))) >= n and ans[0] > x:
        ans[0] = x
        return

    for v in d:
        if v == "0" and len(A) == 0:
            next
        A.append(v)
        dfs(A)
        A.pop()


n, k = map(int, input().split())
d = sorted(list(set([str(i) for i in range(10)]) - set(input().split())))
nn = len(str(n))+1
ans = [10**7]
dfs([])
print(ans)
# Judge status: Accepted
S = input("")
for i in range(len(S)):
    print("x",end="")
# Judge status: Accepted
N = int(input())
s = input()
t = input()

c = None
# i文字一致している
for i in range(N+1):
    sp = s[i:]
    tp = t[:N-i]
    # print(sp, tp)
    if sp == tp:
        c = i
        break

match = N - c
ans = 2 * N - match
# print(c, match, ans)
print(ans)