peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import math

import itertools

x = int(input())
all_a = [a ** 5 for a in range(-70, 70)]

for comb in itertools.combinations(all_a + all_a, 2):
    if comb[0] - comb[1] == x:
        a = int(math.pow(abs(comb[0]), 1 / 5))
        b = int(math.pow(abs(comb[1]), 1 / 5))

        if comb[0] < 0:
            a *= -1
        if comb[1] < 0:
            b *= -1

        print(a, b)
        exit()
# Judge status: Accepted
S = int(input())
N = int(1e9)
x = N - (S - 1) % N - 1
y = (S - 1) // N + 1
print(0, 0, N, 1, x, y)
# Judge status: Accepted
n = int(input())
a = int(input())

if n%500 <= a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c,d = input()
print('Yes' if a==b==c==d or a==b==c or b==c==d else 'No')
# Judge status: Wrong Answer
n, w = map(int, input().split())
a = [[int(i) for i in input().split(" ")] for j in range(n)]
dp = [[0]*(w+1) for i in range(n+1)]
for i in range(1, n+1):
    w_, v_ = a[i-1]
    for j in range(1, w+1):
        if j < w_:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][w-w_]+v_, dp[i-1][w])
print(dp[n][w])
# Judge status: Accepted
N, H = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(N)]

max_a = sorted(ab, key=lambda x: -x[0])[0][0]
bs = sorted([b for a,b in ab if b > max_a], reverse=True)
sum_bs = sum(bs)

if H <= sum_bs:
    for i in range(len(bs)):
        H -= bs[i]
        if H <= 0:
            print(i+1)
            exit()
else:
    H -= sum_bs
    print((H+max_a-1)//max_a + len(bs))
# Judge status: Wrong Answer
x = int(input())
 
def score(x):
 
 if  400 <= x <= 599:
        print("8")
 elif 600 <= x <= 799:
        print("7")
 elif 800 <= x <= 999:
        print("6")
 elif 1000 <= x <= 1199:
        print("5")
 elif 1200 <= x <= 1399:
        print("4")
 elif 1400 <= x <= 1599:
        print("3")
 elif 1600 <= x <= 1799:
        print("2")
 elif 1800 <= x <= 1999:
        print("1")

print(score(x))
# Judge status: Accepted
N = str(input())
if (N[0] == '7')or(N[1] == '7')or(N[2] == '7'):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import collections

l=list(input())
c=collections.Counter(l)
print(c['0'],c['1'])
if c['0']==c['1']:
    print(c['0']*2)
else:
    print(min(c['0'],c['1'])*2)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
A = c - a 
B = d - b 

ans = ''

ans +='R'*A + 'U'*B
ans +='L'*A + 'D'*B
ans +='L'+'U'*B+'U'+'R'*A +'R'
ans +='R'+'D'*B+'D'+'L'*A +'L'+'U'
print(ans)
# Judge status: Wrong Answer
N = int(input())

A = 0

for i in range(N-1):
  for j in range(i,N):
    if str(i)[0] == str(j)[-1] and str(i)[-1] == str(j)[0]:
      print(str(i) + ' ' + str(j))
      A += 1

print(A + 2)
# Judge status: Accepted
a,b,c =sorted(map(int,input().split()))
print("Yes" if (a+b) == c else "No")
# Judge status: Accepted
n = int(input())
print((10**n -2*9**n +8**n) % 1000000007)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=float("inf")
x=0
b=sum(a)
for i in range(n):
    x+=a[1]
    if i+1<n:
        ans=min(ans,abs(b-2*x))    
print(ans)
# Judge status: Wrong Answer
s = map(int,list(raw_input()))
dp = [[0,0] for _ in range(len(s))]
for i in range(len(dp)):
	a = (dp[i - 1][0] if i - 1 >=0 else 0) + s[i]
	b = (dp[i - 1][1] if i - 1 else 1) + 10 - s[i]
	dp[i][0] = min(a,b)

	a = (dp[i - 1][0] if i - 1 >=0 else 0) + s[i] + 1
	b = (dp[i - 1][1] if i - 1 else 1) + 10 - s[i] - 1
	dp[i][1] = min(a,b)
print dp[-1][0]
# Judge status: Accepted
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

import math
#mod = 10**9+7



def main():
  x,y,z = map(int,input().split())
  
  x -= z
  print(x//(y+z))
if __name__ == '__main__':
  main()
# Judge status: Accepted
import sys

H, N = map(int, input().split())
AList = list(map(int, input().split()))

for i in range(0, N):
    H -= AList[i]
    if H <= 0:
        print('Yes')
        sys.exit(0)
        

print('No')
# Judge status: Wrong Answer
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n, k = na()
a = na()

print(n // (k - 1))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b,n=map(int, input().split())
    c=min(b-1,n)
    print((a*c)//b-a*(c//b))
resolve()
# Judge status: Wrong Answer
S = input()
print(S.replace('7', '8'))
# Judge status: Accepted
a=int(input())
x=a//100
y=a%100
c=False
d=False
if 1<= x<=12:
    c=True
if 1<= y<=12:
    d=True
if c==True and d==True:
    print("AMBIGUOUS")
if c==True and d==False:
    print("MMYY")
if c==False and d==True:
    print("YYMM")
if c==False and d==False:
    print("NA")
# Judge status: Accepted
a = input()

if a.isupper():
    print("A")
else:
    print("a")
# Judge status: Wrong Answer
a=list(input())
for i in range(3):
  if a[i]==a[i+1]:
    print('Bad')
    break
  else:
    print('Good')
    break
# Judge status: Accepted
s = input()
a = 1 <= int(s[:2]) <= 12
b = 1 <= int(s[2:]) <= 12
if a and b:
    print("AMBIGUOUS")
elif a:
    print("MMYY")
elif b:
    print("YYMM")
else:
    print("NA")
# Judge status: Accepted
N,M = input().split()
day = input().split()
days = []
for d in day:
    days.append(int(d))

if int(N) >= sum(days):
    print(int(N) - sum(days))
else:
    print(-1)
# Judge status: Accepted
target = list(map(int, input().split()))

num = target[0]
total = target[1]

for i in range(num + 1):
    tori = i
    kame = (num - i)
    if (tori * 2 + kame * 4) == total:
        print('Yes')
        break
else:
    print('No')
# Judge status: Wrong Answer
import math
from collections import defaultdict


N = int(input())
n = N
#素因数分解
factor = defaultdict(lambda: 0)
tmp = int(math.sqrt(N))+1
for num in range(2,tmp):
    while N % num == 0:
        N //= num
        factor[num] += 1
if not factor:
    factor[n] += 1
else:
    factor[N] += 1



ans = 0
for num in factor:
    i = 1
    while True:
        factor[num] -= i
        if factor[num]<0:
            break
        ans += 1
        i+=1

print(ans)
# Judge status: Wrong Answer
K, X = map(int, input().split())


if (K * 500) > X:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
sys.setrecursionlimit(2000)

N = int(input())

# def Lucas(x):
#     if x == 2:
#         return 1
#     if x == 1:
#         return 2
#     return Lucas(x - 1) + Lucas(x - 2)
# answer = Lucas(N)

L = [0] * (N+1)
L[0] = 2
L[1] = 1
for i in range(2, N+1):
    L[i] = L[i-1] + L[i-2]

print(L[N])
# Judge status: Accepted
n = int(input())
S = [int(input()) for _ in range(n)]
total = sum(S)
if total % 10 == 0:
    l = [s for s in S if s % 10 != 0]
    if l:
        total -= min(l)
    else:
        total = 0
print(total)
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())
print(n // max(h,w))
# Judge status: Wrong Answer
arr = [1,2,3,0,5]
def find(x):
  if x == 0:
    return arr[i]
# Judge status: Wrong Answer
x, y = map(int, input().split())

if 0 <= x <= y or x <= y <= 0:
    print(y - x)
elif x <= 0 <= y:
    print(abs(y + x) + 1)
elif 0 <= y <= x or y <= x <= 0:
    print(abs(x - y) + 2)
else:
    print(abs(x + y) + 1)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
L = [0]*N
for i in range(0, N):
    L[A[i]-1] = i + 1
    print(L,A[i])
print(*L)
# Judge status: Wrong Answer
import math
c=input()
b=input()
a=input()
if c>b:
    print(math.ceil(int(a)/int(c)))
else:
    print(math.ceil(int(a)/int(b)))
# Judge status: Accepted
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    a, b = map(int, input().split())
    print(a*b)
    
main()
# Judge status: Accepted
import numpy as np

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

#ans = np.prod(Alist)
Alist.sort()
ans = 1
for i in range(N):
  #print (Alist[i])
  ans*= Alist[i]
  if Alist[i]==0:
    break
  if ans >10**18:
    break

if ans >10**18:
  print(-1)
else:
  print(ans)
# Judge status: Accepted
N = int(input())
W = list(map(int, input().split()))
ans =101
for i in range(N):
    s1 = sum(W[:i+1])
    s2 = sum(W[i+1:])
    ans = min(ans, abs(s1 -s2))
print(ans)
# Judge status: Wrong Answer
import math
 
N = int(input())
 
min_cand = 10**9
 
for i in range(1,(int(math.sqrt(N))+1)):
  if N % i == 0 and min_cand > (i + (N // i)):
    min_cand = (i + (N // i))
    
print(min_cand - 2)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
A.sort()
while len(A)>=2: 
    X = int((A[0]+A[1])/2)
    A.pop(0)
    A.pop(0)
    A.append(X)
    A.sort()
else:
    print(*A)
# Judge status: Accepted
import math

n,m=map(int,input().split())
a=math.factorial(n) * math.factorial(m) 
if abs(n-m) == 0:
    a *= 2
elif abs(n-m) > 1:
    a = 0
print(a%1000000007)
# Judge status: Accepted
import heapq

n, m = map(int, input().split())
l = [[] for _ in range(m)]
 
for i in range(n):
    a, b = map(int, input().split())
    if a <= m:
        l[a - 1].append(b)

a = []
ans = 0

for k in range(m - 1, -1, -1):
    i = m - k - 1
    for j in l[i]:
        heapq.heappush(a, (-1) * j)
    if a:
        ans += heapq.heappop(a) * (-1)
        
print(ans)
# Judge status: Accepted
from collections import deque
print("Yes")

N,M=map(int,input().split())
lst=[[] for _ in range(N)]
for _ in range(M):
    a,b=map(int,input().split())
    lst[a-1].append(b-1)
    lst[b-1].append(a-1)
q=deque(lst[0])
go=[None]*N
for i in lst[0]:
    go[i]=0
while q:
    v=q.popleft()
    for new in lst[v]:
        if go[new]==None:
            go[new]=v
            q.append(new)
for i in go[1:]:
    print(i+1)
# Judge status: Wrong Answer
x, n = map(int, input().split())
p = list(map(int, input().split()))

if n == 0:
    print(x)
    exit()

cnt = [0] *101
ans1 = 0
ans2 = 0

for _p in p:
    cnt[_p] += 1

for i in range(x, 101):
    if cnt[i] == 0:
        ans1 = i
        break

for i in range(x-1, -100, -1):
    if cnt[i] == 0:
        ans2 = i
        break

if abs(ans1 - x) < abs(ans2 - x):
    print(ans1)
elif abs(ans1 - x) >= abs(ans2 - x):
    print(ans2)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

x = a[0] // 2
l = 1
r = N - 1
while r - l > 1:
    mid = l + (r - l) // 2
    if a[mid] < x:
        r = mid
    else:
        l = mid
if abs(x - a[l]) <= abs(x - a[r]):
    print(a[0], a[l])
else:
    print(a[0], a[r])
# Judge status: Accepted
s = open(0).read().rstrip()
n = len(s)

from collections import defaultdict
ans = defaultdict(int)
ans[-2] = -1
ans[-1] = 0
ans[0] = 1

for i in range(1,n):
    if s[i] != s[i-1]:
        ans[i] = ans[i-1]+1
    else:
        ans[i] = ans[i-3]+2

print(ans[n-1])
# Judge status: Accepted
a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    N=int(input())
    S=str(input())
    print('Yes' if S[:N//2]==S[N//2:] else 'No')

resolve()
# Judge status: Wrong Answer
s = str(input())
apple = ["SUN","MON","TUE","WED","THU","FRI","SAT","SUN"]
print(apple[apple.index(s) + 1])
# Judge status: Accepted
s=input()
if s[0]!=s[1] and s[1]!=s[2] and s[2]!=s[0]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# -*- coding: utf-8 -*-

import fractions
from functools import reduce

N = int(input())
A = list(map(int, input().split()))
mod = 10 ** 9 + 7


def lcm_base(x, y):
    return ((x * y) // fractions.gcd(x, y))


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


min_AB = lcm(*A)

ans = 0
for a in A:
    ans += min_AB // a

print(ans % mod)
# Judge status: Accepted
s = input()

ans = 1000

for i in range(len(s)-2):
  t = int(s[i:i+3])
  a = abs(753 - t)
  ans = min(ans, a)

print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    w = list(map(int, input().split()))
    minv = 100
    for i in range(n):
        minv = min(minv, abs(sum(w[:i])-sum(w[i:])))
    print(minv)
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
n, m = map(int, input().split())
p = [list(map(int, input().split())) for _ in range(m)]
ln1 = []
ln2 = []
for i in p:
    if i[0] == 1:
        ln1.append(i[1])
for j in p:
    if j[1] == n:
        ln2.append(j[0])

if len(set(ln1) & set(ln2)) == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
ans=float('inf')
for i in range(-100, 101):
    tmp=0
    for j in range(n):
        tmp+=(i-a[j])**2
    ans=min(tmp,ans)
print(ans)
# Judge status: Accepted
n,*a=map(int, open(0).read().split())
print(sum(sorted(a)[n:][::2]))
# Judge status: Accepted
n,m = list(map(int, input().split()))
# 隅は必ず表
# 辺は行か列なら1なら裏、以外は表
# 上記以外は裏

if n==1 and m==1:
    print(1)
elif n==1 or m==1:
    print(max(n,m)-2)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, M = map(int, rl().split())
    
    left = [i for i in range(M)]
    right = [2 * M - 1 - v for v in left]
    
    for i in range(M // 2):
        right[i] -= 2 * M + 1
    
    for i in range(M):
        left[i] %= N
        left[i] += 1
        right[i] %= N
        right[i] += 1
    
    for a, b in zip(left, right):
        print(a, b)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
s = input()
t = input()

count = 0
l = len(s)

for i in range(l):
    if s[i] != t[i]:
        count += 1

print(count)
# Judge status: Wrong Answer
n = int(input())

l0 = 2
l1 = 1
if n==1:
    print(l1)
ans = 0
for i in range(n - 1):
    ans = l0 + l1
    l0 = l1
    l1 = ans

print(ans)
# Judge status: Accepted
from fractions import gcd
a,b,c,d = [int(x) for x in input().split()]

def div(x, y, z):
    return x - (x // y) - (x // z) + (x // (y * z // gcd(y, z)))

ans = div(b, c, d) - div(a-1, c, d)
print(ans)
# Judge status: Accepted
from collections import Counter
from collections import deque
n, k = map(int, input().split())
a = Counter(list(map(int, input().split())))
a = [tuple(i) for i in a.items()]
a.sort(key=lambda x: x[1])
a = deque(a)
ans = 0
while k<len(a):
    ans += a.popleft()[1]
print(ans)
# Judge status: Accepted
n=int(input())
ls=list(map(int,input().split()))
copy=[0]*n
for i in range(n):
    copy[ls[i]-1]=i+1
for i in copy:
       print(i,end=" ")
# Judge status: Accepted
N,R=map(int,input().split())
if N>=10:
    print(R)
else:
    print(R+100*(10-N))
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
num=0
for i in range(N):
    num+=A[i]**2
print(int(((sum(A)*sum(A)-num)/2)%1000000007))
# Judge status: Accepted
import math

n, k = map(int, input().split())
A = list(map(int, input().split()))

l = 1
r = 10**9+1

while l < r:
    mid = (l+r)//2
    count = 0
    for i in range(n):
        if A[i] > mid:
            count += math.ceil(A[i]/mid-1)

    if count <= k:
        r = mid
    else:
        l = mid+1


print(l)
# Judge status: Accepted
n, m = map(int, input().split())
L = 1
R = n
for i in range(m):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)
if l > R:
    print(0)
else:
    print(R - L + 1)
# Judge status: Accepted
s = input()
k = int(input())

for i in range(k):
    if s[i] != "1":
        print(s[i])
        exit()
    
print(1)
# Judge status: Accepted
n = int(input())
ans = 1
for i in range(7):
  if 2 ** i <= n: ans = 2 ** i
print(ans)
# Judge status: Accepted
a, b, c = [int(x) for x in input().split()]

if (c - (a - b)) > 0:
    print(c - (a - b))
else:
    print(0)
# Judge status: Accepted
import sys
S = str(input())
T = str(input())


for i in range(len(S)):
    S = S[-1]+S[:-1]
    if S == T:    
        print("Yes")
        sys.exit()
print("No")
# Judge status: Accepted
N=int(input())
x=N*800
y=200*(N//15)
print(x-y)
# Judge status: Accepted
l = int(input())
print((l/3)**3)
# Judge status: Accepted
L, R = map(int, input().split())

ans = 2020
for i in range(L, R + 1):
    for j in range(i + 1, R + 1):
        val = (i * j) % 2019
        ans = min(ans, val)
        if val == 0:
            print(ans)
            exit()

print(ans)
# Judge status: Accepted
y = str(input())
ans = ["NA","MMYY","YYMM","AMBIGUOUS"]
k = 0
if 1 <= int(y[:2]) <= 12:
  k += 1
if 1 <= int(y[2:]) <= 12:
  k += 2
print(ans[k])
# Judge status: Wrong Answer
h,n = map(int,input().split())
dp = [1e8] * (h+1)
dp[0] = 0
for i in range(n):
    a, b = map(int, input().split())
    for j in range(h):
        nj = min(j+a, h)
        dp[nj] = min(dp[nj], dp[j]+b)
print(dp[h])
# Judge status: Accepted
x = input()
visited = [0]*(len(x))
ans = 0
s = 0
t = 0
for i in range(len(x)):
    if not visited[i]:
        if x[i:i+2] == "ST":
            ans += 2
            visited[i+1] = 1
        elif x[i] == "S":
            s += 1
        elif x[i] == "T" and s:
            ans += 2
            s -= 1
print(len(x)-ans)
# Judge status: Wrong Answer
W, a, b = map(int,input().split())
print(min(max(0,a+W-b),max(0,a-W-b)))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
total = sum(A)
mid = total // 2
sum_left, sum_left2 = 0, 0
seperation_i = 0
# for i, l in enumerate(A[:-1]):
for i, l in enumerate(A):
  sum_left += l
  if sum_left >= mid:
    seperation_i = i
    sum_left2 = sum_left - l
    break
sum_right, sum_right2 = sum(A[seperation_i + 1:]), sum(A[seperation_i:])
ans = min(abs(sum_left - sum_right), abs(sum_left2 - sum_right2))
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
print(a-(b<a))
# Judge status: Wrong Answer
from itertools import product
import math


def deg2int(digits):
    return sum(d * 10**p for p, d in enumerate(digits))


N = input()
N0 = int(N[0])
N = int(N)
m = 0
m_dig = [0]
k = math.floor(math.log10(N))
for i in (k, k + 1):
    for digits in product([8, 9], repeat=i):
        n = deg2int(digits)
        s = sum(digits)
        if n <= N and s > m:
            m = s
            m_dig = digits

if len(m_dig) == k:
    m += N0 - 1
print(m)
# Judge status: Accepted
import numpy as np


w, h, n = map(int, input().split())
v = np.zeros((h, w), dtype=np.int)
for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        v[:, :x] = 1
    elif a == 2:
        v[:, x:] = 1
    elif a == 3:
        v[:y, :] = 1
    else:
        v[y:, :] = 1
print(w*h-np.sum(v))
# Judge status: Wrong Answer
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    if 10*i+j==n and a<i+j and i+j<b :
      sum += 10*i + j
print(sum)
# Judge status: Accepted
n = int(input())

csfn = [None] * (n - 1)
for i in range(n - 1):
    csfn[i] = list(map(int, input().split(' ')))

result = [0] * n

for i in range(n - 1):
    for j in range(0, i + 1):
        if csfn[i][1] > result[j]:
            result[j] += (csfn[i][1] - result[j])
        else:
            result[j] += (-result[j] % csfn[i][2])
        result[j] += csfn[i][0]
        
for r in result:
    print(r)
# Judge status: Accepted
S = list(input())
alphabet = []

for i in range(26):
    alphabet.append(chr(i+97))

x = set(S)

for i in alphabet:
    if i not in x:
        print(i)
        exit()

print('None')
# Judge status: Accepted
a,b,c,d = map(int,input().split())
s = []
s += ["U"]*(d-b)+["R"]*(c-a)+["D"]*(d-b)+["L"]*(c-a)
s += ["L"]+ ["U"]*(d-b+1)+["R"]*(c-a+1)+["D"]+["R"]
s += ["D"]*(d-b+1)+["L"]*(c-a+1)+["U"]
print("".join(s))
# Judge status: Wrong Answer
from collections import deque
n,m=map(int,input().split())
l=[[0] for _ in range(n+1)]
vi=[0 for _ in range(n+1)]
vi[1]=-1

for i in range (m):
  a,b=map(int,input().split())
  l[a].append(b)
  l[b].append(a)
st=deque([1])
e=set()

def bfs(x):
  if x not in e:
    e.add(x)
    for k in l[x]:
      if k not in e:
        st.append(k)
        vi[k]=x              
  return
while st:
  
  bfs(st.popleft())
  
print("Yes")
for m in vi[2:]:
  print(m)
# Judge status: Accepted
N, M = map(int, input().split())

x = min(N, M//2)

ans = x + (M - 2 * x) // 4
print(ans)
# Judge status: Accepted
n=int(input())
num=[int(input()) for _ in range(5)]
print(4-(n//-min(num)))
# Judge status: Wrong Answer

s=str(input())
a = len(s)
for i in range(a):
    print('x',sep="")
# Judge status: Accepted
import sys


def main():
    n = int(input())
    a = n // 7
    for i in range(a+1):
        mod = n - i*7
        if mod % 4 == 0:
            print('Yes')
            sys.exit(0)
    print('No')


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
x,y=map(int,input().split())
a=[4,6,9,11]
print('Yes' if x==y==2 or (x in a and y in a) or (x not in a and y not in a) else 'No')
# Judge status: Accepted
n = int(input())

dp = [0]*100001
dp[100],dp[101],dp[102],dp[103],dp[104],dp[105] = 1,1,1,1,1,1

for i in range(99896):
    if dp[i] == 1:
        dp[i+100],dp[i+101],dp[i+102],dp[i+103],dp[i+104],dp[i+105] = 1,1,1,1,1,1
print(dp[n])
# Judge status: Wrong Answer
n, l = map(int, input().split())
list = []
for s in range(n-1):
  list.append(input())

s_list = sorted(list)
print(*s_list, sep='')
# Judge status: Accepted
from math import ceil

n, m = (int(x) for x in input().split())
if n % 2 == 1:
    for i in range(1, m + 1):
        print(i, n - i)
else:
    k = (n - 2) // 2
    l = ceil(k / 2)
    ANS = []
    for i in range(1, l+1):
        ANS.append((i, n - i + 1))
    for i in range(l+2, k+2):
        ANS.append((i, n - i + 2))
    for a, b in ANS[:m]:
        print(a, b)
# Judge status: Wrong Answer
S = input()

def solve(T) :
    while 1:
        flag = True
        for i in ("dream", "dreamer", "erase", "eraser"):
            if T.endswith(i):
                T = T[: -len(i)]
                flag = False
                break
        
        if flag:
            print("NO")
            break
        
        if len(T) == 0:
            print("Yes")
            break

solve(S)
# Judge status: Accepted
from itertools import permutations as per
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
PQ = list(per(list(range(1, N + 1))))

a = PQ.index(P) + 1
b = PQ.index(Q) + 1

print(abs(a - b))
# Judge status: Accepted
import itertools
n = int(input())
a = list(itertools.accumulate(list(map(int, input().split()))))
sum_a = a[-1]
res = 2020202020
for i in range(n):
  res = min(res, abs(sum_a - a[i]*2))
print(res)
# Judge status: Accepted
n = int(input())
s = str(input())
dic = {}
for i in s:
    dic.setdefault(i,0)
    dic[i] += 1
#print(dic)
move = {}
ans = []
cnt = 0
for i in s:
    dic[i] -= 1
    move.setdefault(i,0)
    move[i] += 1
    if dic[i]>0 and move[i]>0:
        if i not in ans:
            ans.append(i)
    elif dic[i]==0:
        if i in ans:
            ans.remove(i)
    cnt = max(cnt,len(ans))
print(cnt)
# Judge status: Accepted
n = int(input())
ans = 0
if n < 105:
    print(0)
else:
    for i in range(1,n+1,2):
        count = 0
        for l in range(1, i+1, 2):
            if i % l == 0:
                count += 1
        if count == 8:
            ans += 1
    print(ans)
# Judge status: Accepted
N = int(input())

f = [0] * (10 ** 4 + 1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if n <= 10 ** 4:
                f[n] += 1
print(*f[1 : N + 1], sep="\n")
# Judge status: Accepted
N = int(input())
v = list(map(int, input().split()))
v = sorted(v)

ans = (v[0]+v[1])/2
if N>2:
  for i in range(2,N):
    ans = (ans + v[i])/2

print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
if a > b:
    n =a+(a-1)
elif b > a:
    n = b+(b-1)
else:
    n = a+b

print(n)
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())

if x > y:
    tmp = c*y*2+a*(x-y)
else:
    tmp = c*x*2+b*(y-x)

ans = min(a*x+b*y, c*max(x, y)*2, tmp)
print(ans)
# Judge status: Accepted
n, m = map(int,input().split())
for i in range(m//n, -1 , -1):
    if m%i == 0:
        print(i)
        exit()