peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a,b,c,x,y = map(int,input().split())
res = 9999999999999
for i in range(0, 200002, 2):
    na = x - i//2
    nb = y - i//2
    na = 0 if na < 0 else na
    nb = 0 if nb < 0 else nb
    res = min(res, c * i + a*na + b*nb)
print(res)
# Judge status: Accepted
import sys
N, M, K = list(map(int, input().split()))
for i in range(N + 1):
    for j in range(M + 1):
        if (M - j) * i + (N - i) * j == K:
            print('Yes')
            sys.exit()
print('No')
# Judge status: Accepted
from collections import Counter
n = int(input())
a = Counter(list(map(int, input().split())))
ans = 0
for x,y in a.items():
    if y<x: ans += y
    else:ans += y-x
print(ans)
# Judge status: Accepted
mod=10**9+7
N=int(input())
ans=1
for i in range(1,N+1):
  ans*=i
  ans%=mod
print(ans)
# Judge status: Wrong Answer
i1 = input()
i2 = input()

# i1 = "4 1"
# i2 = "5 4 2 1"
list1 = [int(s) for s in i1.split()]
list2 = [int(s) for s in i2.split()]

n = list1[0]
m = list1[1]


total = sum(list2)

# 選べる
count = 0

for a in range(n):
    if (list2[a]/total >= 1/(4*m)):
        count += 1 

if count == m:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s=input()
t=[]
for i in range(4):
  if s[i] in t:
    t.append(t[i])
if len(t)==2:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
X = int(input())

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

for i in range(X + 1):
    dp[i + 100] = max(dp[i], dp[i + 100])
    dp[i + 101] = max(dp[i], dp[i + 101])
    dp[i + 102] = max(dp[i], dp[i + 102])
    dp[i + 103] = max(dp[i], dp[i + 103])
    dp[i + 104] = max(dp[i], dp[i + 104])
    dp[i + 105] = max(dp[i], dp[i + 105])

print(dp[X])
# Judge status: Accepted
from sys import stdin
readline = stdin.readline
def i_input(): return int(readline().rstrip())
def i_map(): return map(int, readline().rstrip().split())
def i_list(): return list(i_map())


def main():
    S = readline().rstrip()
    ans =S + "s" if S[-1] != "s" else S + "es"
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import defaultdict
Lineger_Dict = defaultdict(int)
N = int(input())
N_List = list(map(int,input().split()))
for i in N_List:
    Lineger_Dict[i] += 1

    
Rec = sorted([k for k,v in Lineger_Dict.items() if v >= 2] + [k for k,v in Lineger_Dict.items() if v >= 4])
if len(Rec) < 2:
    print(0)
else:
    print(Rec[-1]*Rec[-2])
# Judge status: Wrong Answer
N=int(input())
a=[int(input()) for i in range(N)]
sw=True
b=sorted(a,reverse=True)

for j in range(N-1):
    if b[j]>b[j+1]:
        max2=b[j+1]
        max1=b[j]
        sw=False
        break

if sw==True:
    max1=b[0]
    for k in range(N):
        print(max1)
else:
    for k in range(N):
        if a[k]==max1:
            print(max2)
        else:
            print(max1)
# Judge status: Wrong Answer
S = input()

y = S[0:4]
m = S[5:7]
d = S[8:10]

if y < "2019":
    print("Heisei")

elif (y == "2019") and (m < "4"):
    print("Heisei")

elif (y == "2019") and (m == "4") and (d <= "30"):
    print("Heisei")

elif (y == "2019") and (m == "4") and (d > "30"):
    print("TBD")

elif (y == "2019") and (m >= "5"):
    print("TBD")

elif (y > "2019"):
    print("TBD")
# Judge status: Wrong Answer
a,b,c=list(map(int,input().split()))
d=a//b
print(int(d*c))
# Judge status: Accepted
a,b,c,d=input()
for i in range(2**3):
    ls = ["+","+","+"]
    for j in range(3):
        if (i >> j) & 1:
            ls[j] = "-"
    if eval(a+ls[0]+b+ls[1]+c+ls[2]+d) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break
# Judge status: Accepted
S=input()
ecount=0
wcount=0
ncount=0
scount=0
flag=1
for i in range(len(S)):
    if S[i]=="E":
        ecount=ecount+1
    elif S[i]=="W":
        wcount=wcount+1
    elif S[i]=="N":
        ncount=ncount+1
    else:
        scount=scount+1
if (ncount>0)or(scount>0):
    if (ncount*scount==0):
        flag=0
if (wcount>0)or(ecount>0):
    if (wcount*ecount==0):
        flag=0
if flag==0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
A,B,C = map(int,input().split())

print(max(C-(A-B),0))
# Judge status: Accepted
_, c, k, *lst = map(int, open(0).read().split())
lst.sort()
res = 1
tmpt = lst[0]
tmpc = 0
for i in lst:
  tmpc += 1
  if not (tmpc <= c and i - tmpt <= k):
    res += 1
    tmpc = 1
    tmpt = i

print(res)
# Judge status: Accepted
a, b, c = map(int, input().split())
print('Yes' if (a + b) >= c else 'No')
# Judge status: Accepted
import sys
input = sys.stdin.readline

K=int(input().rstrip('\n'))
if K % 2 ==0:
  print(-1)
else:
  now = 7
  check = 0
  for i in range(1,K+1):
    if now % K ==0:
      print(i)
      check += 1
      break
    else:
      now = now%K
      now = now*10
      now += 7 
  if check ==0:
    print(-1)
# Judge status: Accepted
n = int(input())
arr = list(map(int,input().split()))

tot = sum(arr)

temp = 0
ans = 1e18
for i in range(n):
    temp += arr[i]
    rest = tot-temp
    cost = abs(rest-temp)
    if cost < ans:
        ans = cost

print(ans)
# Judge status: Accepted
S = input()

ans = min(S.count("0"), S.count("1")) * 2
print(ans)
# Judge status: Accepted
def main():
    N = int(input())
    S = input()

    ans = ''
    for i in range(len(S)):
        o = (ord(S[i]) - 65 + N)%26 + 65
        ans += chr(o)
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import functools


def new_ingredient(x, y):
    return (x + y) / 2


def main():
    n = int(input())
    v = [int(x) for x in input().split()]

    v.sort()
    max_value = functools.reduce(new_ingredient, v)

    print(max_value)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
def main():
 n,m = map(int,input().split())
 print(n * (n - 1) / 2 + m * (m - 1) / 2)
main()
# Judge status: Wrong Answer
S = input()

if len(S) == 2:
  if S == 'hi':
    print('Yes')
  else:
    print('No')
else:
  flag = 0
  i = 0
  while i < len(S)-1:
    if S[i:i+2] == 'hi':
      flag = 1
    else:
      flag = 0
      break
    i += 2
  if flag == 1:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

from collections import defaultdict
c = defaultdict(int)
cm = set()
c2 = list()
num = 0
for i in range(N):
  c[A[i]] += 1
  cm.add(A[i])
for i in list(cm):
  num += c[i]*(c[i]-1)//2
for i in range(N):
  ans = num - c[A[i]] + 1
  c2.append(ans)

for cs in c2:
  print(cs)
# Judge status: Accepted
#coding:utf-8
n = int(input())
ans = 0

#n以下のすべての奇数について全探索
for i in range(1, n+1, 2):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
        if count == 8:
            ans += 1

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

if n * 2 > m:
    print(n)
else:
    print((m - 2*n) // 4 + n)
# Judge status: Wrong Answer
r,g,b=map(int,input().split())
n=100*r+10*g+b
if n%4==0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b = raw_input().split()
a_ans = ""
b_ans = ""
for i in range(int(b)):
  a_ans += a
for i in range(int(a)):
  b_ans += b
if int(a) >= int(b):
  print b_ans
else:
  print a_ans
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**6)

w, h, x, y = map(int, input().split())

area = max(min(w*y, w*(h-y)), min(x*h, (w-x)*h))
is_multi = 0

if area in [w*y, w*(h-y)] and x == w//2:
    is_multi = 1
elif area in [x*h, (w-x)*h] and y == h//2:
    is_multi = 1
    
print(area, is_multi)
# Judge status: Accepted
x = int(input())

if x <= 40 and x >= 30:
    print("Yes")

else:
    print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline

S = input().rstrip()
from collections import Counter

c = Counter(S)

if len(c.keys()) == 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())

print(1000 - (N % 1000))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
if 0 in a:
  print(sum(abs(i)for i in a))
else:
  pc=mc=0
  for i in range(n):
    if a[i]>0:pc+=1
    else:mc+=1
    a[i]=abs(a[i])
  if mc%2:print(sum(a)-min(a)*2)
  else:print(sum(a))
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split()))
ans = []
for i in range(1,100):
    sum = 0
    for j in range(n):
        sum = sum +((x[j]-i)**2)
    ans.append(sum)
print(min(ans))
# Judge status: Accepted
N = int(input())
res = N%1000

if res == 0:
  print(res)
else:
  print(1000-res)
# Judge status: Accepted
import sys
import math
input = sys.stdin.readline

x = int(input())

if 105 * math.floor(x / 100) >= x:
  ans = '1'
else:
  ans = '0'

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

N = X[0]
b = X[1]
r = X[2]

if b == 0:
    print(0)
elif b + r == N:
    print(b)
else:
    print(b + (N - (b + r)))
# Judge status: Accepted
import copy
n = int(input())
x = list(map(int, input().split()))
y = copy.deepcopy(x)
y.sort()
mid_bigger = y[int(n/2)]
mid_smaller = y[int(n/2)-1]
ans = [0]*n
for i in range(0,n):
    if (x[i]<mid_bigger):
        ans[i]=mid_bigger
    elif (x[i]>mid_smaller):
        ans[i]=mid_smaller
    elif (mid_smaller == x[i]):
        ans[i] = mid_bigger
    else:
        ans[i] = mid_smaller
print(*ans, sep='\n')
# Judge status: Wrong Answer
input_str = input().split(" ")

a = int(input_str[0])
b = int(input_str[1])

product = a * b

if product % 2 == 1:
  print("odd")
else:
  print("even")
# Judge status: Accepted
k = int(input())
a = []
for i in range(k):
    a.append(input())



print(len(set(a)))
# Judge status: Accepted
n, m = map(int, input().split())
answer = [[False, 0] for _ in range(n)]
for i in range(m):
    number, result = input().split()
    number = int(number)
    if result == 'AC':
        answer[number-1][0] = True
    elif answer[number-1][0] != True:
        answer[number-1][1] += 1

ret = [ans[1] for ans in answer if ans[0] == True]
print(len(ret), sum(ret))
# Judge status: Accepted
a,b,c = input().split()
print("A"+b[0]+"C")
# Judge status: Wrong Answer
l = list(map(int, input().split()))
if l[0]%2==0 or l[1]%2==0:
    print(l[0]*l[1]//2)
else:
    print(l[0]*l[1]//2+1)
# Judge status: Accepted
S = input()
dic = {'SUN': 7, 'SAT': 1, 'FRI': 2, 'THU': 3, 'WED': 4, 'TUE': 5, 'MON': 6}
print(dic[S])
# Judge status: Accepted
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
dp=[[0]*3 for _ in range(n)]
dp[0]=l[0]
for i in range(n-1):
  for j in range(3):
    dp[i+1][j]=max(dp[i][(j+1)%3]+l[i+1][j],dp[i][(j+2)%3]+l[i+1][j])
print(max(dp[n-1]))
# Judge status: Accepted
n = int(input())
a_l = list(map(int,input().split()))

a_dict = {}
for num in a_l:
    if num in a_dict:
        a_dict[num] += 1
    else:
        a_dict[num] = 1

comb_dict = {}
comb_tot = 0
for num in a_dict:
    comb_dict[num] = a_dict[num]*(a_dict[num]-1)//2
    comb_tot += comb_dict[num]

for num in a_l:
    ans = comb_tot - (a_dict[num]-1)
    print(ans)
# Judge status: Accepted
A, B =map(int, input().split())
if A==1:
    A=14
if B==1:
    B=14
print("Alice" if A>B else "Bob" if B>A else "Draw")
# Judge status: Accepted
def make_divisors(n):
    ans=0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans+=1
            if i != n // i:
                ans+=1
    return ans

n=int(input())
a=0
for i in range(1,n+1,2):
    if make_divisors(i)==8:
        a+=1
print(a)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
d=a-b
e=a-c
f=b-c
if d*e*f==0 and (d+e+f!=0):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = map(int, input().split())
print("Possible" if a%3==0 or b%3==0 or (a+b)%3==0 else "Impossible")
# Judge status: Accepted
k = int(input())

p = k // 2

if k % 2 == 0:
    print(p * p)
elif k % 2 > 0:
    print(p*(p+1))
# Judge status: Accepted
import sys
sys.setrecursionlimit(500000)

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    A, B, C = mi()
    for i in range(B):
        if (A*i)%B == C:
            print('YES')
            return
    print('NO')

if __name__ == '__main__':
    main()
# Judge status: Accepted
x,y = map(int,input().split())
y =y**2
count=0
for i in range(x):
    a,b = map(int,input().split())	
    if a**2+b**2 <=y:
        count+=1;
print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
c = 0
m = 10**10
flag = 0
ans = 0
for i in a:
    if i == 0:
        flag = 1
    if i < 0:
        c += 1
    ans += abs(i)
    m = min(m,abs(i))
if c%2 == 0:
    flag = 1
if flag:
    print(ans)
else:
    print(ans-(2*m))
# Judge status: Accepted
# C Skill Up

def list_add(li1, li2):
  return [a+b for a, b in zip(li1, li2)]

N, M, X = map(int, input().split())
data = []
for n in range(N):
  data.append(list(map(int, input().split())))

ans = 10000000
for c in range(1 << N):
  x = [0] * M
  yen = 0
  for i, n in enumerate(format(c, f"{N}b")):
    if n == "1":
      yen += data[i][0]
      x = list_add(x, data[i][1:])
  for xm in x:
    if xm < X:
      break
  else:
    ans = min(ans, yen)
    
if ans == 10000000:
  print(-1)
else:
  print(ans)
# Judge status: Accepted
X = input()

if X == "ABC":
	print("ARC")
else:
	print("ABC")
# Judge status: Accepted
def resolve():
  a = int(input())
  b = int(input())
  c = int(input())
  x = int(input())
  ans = 0
  for i in range(a+1):
    for j in range(b+1):
      for k in range(c+1):
        if 500 * i + 100 * j + 50 * k == x:
          ans += 1
  print(ans)
  return

if __name__ == "__main__":
  resolve()
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
cnt=1
for i in A:
  if i==cnt:
    cnt+=1
if cnt==1:
  print(-1)
else:
  print(N-cnt+1)
# Judge status: Accepted
N = int(input()); print(sum((((N // i) * (2 * i + (N // i - 1) * i) // 2) for i in range(1, N + 1))))
# Judge status: Accepted
N = int(input())

for i in range(8):
    if 2 ** i > N:
        print(2 ** (i-1))
        break
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l = sorted(l,reverse=1)

A,B = 0,0
for i in range(n):
    if (i+1)%2==1:
        A += l[i]
    else:
        B += l[i]
print(A-B)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    work_list = [tuple(map(int, input().split())) for i in range(n)]

    total = 0
    target = {0, 1, 2}
    pre = {-1}
    for work in work_list:
        max_val = 0
        now_target = target - pre
        for i in now_target:
            if max_val < work[i]:
                max_val = work[i]
                pre = {i}
        total += max_val

    print(total)


if __name__ == '__main__':
    main()
# Judge status: Accepted
s=input();print('YNEOS'[max(L:=[s.count(x)for x in 'abc'])-min(L)>1::2])
# Judge status: Wrong Answer
n = int(input())
ans = 0
for _ in range(1, n+1):
    y = n // _
    ans += y * (y + 1) / 2 * _  
print(ans)
# Judge status: Accepted
from collections import Counter
 
N = int(input())
d = Counter(map(int, input().split()))
 
sticks_len = []
for k, v in d.items():
  if v >= 2:
    sticks_len.append(k)
  if v >= 4:
    sticks_len.append(k)
    
sticks_len.sort()
 
if len(sticks_len) >= 2:
  print(sticks_len[-1] * sticks_len[-2])
else:
  print(0)
# Judge status: Accepted
a, b, c, k = map(int, input().split())

if a >= k:
    print(k)
elif a + b >= k:
    print(a)
else:
    print(a - (k -(a+b)))
# Judge status: Accepted
sa = input()
sb = input()
sc = input()

t = "a"
while True:
  if t == "a":
    if len(sa) == 0: break
    t = sa[0]
    sa = sa[1:]
  elif t == "b":
    if len(sb) == 0: break
    t = sb[0]
    sb = sb[1:]
  elif t == "c":
    if len(sc) == 0: break
    t = sc[0]
    sc = sc[1:]

print(t.upper())
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
count=0
ans=0
for i in range(n):
    ans+=b[a[i]-1]
    print(ans)
    if count!=n-1:
        if a[count]+1==a[count+1]:
            ans+=c[a[count]-1]
            print(ans)
    count+=1
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
money_time = A * C
if money_time <= B:
  print(A)
else:
  print(B // A)
# Judge status: Accepted
a,b=map(int,input().split())
list = [0]*a
t_cnt = 0
f_cnt = [0]*a
for i in range(b):
  c, d = map(str,input().split())
  x = int(c) - 1
  if list[x] == 0:
    if d == 'AC':
        list[x] = 1
        t_cnt += 1
    else:
        f_cnt[x] += 1
for i in range(a):
  if list[i] ==0:
    f_cnt[i] = 0
print("{} {}".format(t_cnt, sum(f_cnt)))
# Judge status: Accepted
# C - Energy Drink cntlector

N, M = map(int, input().split())
AB = []
for i in range(N):
    ab = list(map(int, input().split()))
    AB.append(ab)

AB = sorted(AB, key=lambda x: x[0])

cnt = 0
ans = 0
for i in range(N):
    cnt = min(M, AB[i][1])
    M -= cnt
    ans += AB[i][0] * cnt
    if M==0:
        break

print(ans)
# Judge status: Accepted
A = input().split()

print("A"+ str(A[1][0]) + "C")
# Judge status: Wrong Answer
k, n = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
ct = 0
ans = 1
i = 0
while ct <= n:
  ct += l[i]
  ans += (ct <= n)
print(ans)
# Judge status: Wrong Answer
num=input()
if int(num)<=1000:
    change=1000-int(num)
else:
    array_1=list(num)
    array_1=array_1[-4:]
    a=''.join(array_1)
    b=int(array_1[-4])+1
    pay=b*1000
    change=pay-int(a)
    if array_1[-1]=="0" and array_1[-2]=="0" and array_1[-3]=="0":
        change=0
print(change)
# Judge status: Wrong Answer
n, k, s = map(int, input().split())
s1 = str(s)
print((s1 + " ") * (k - 1) + '1 ' * (n - k) + str(s - n + k))
# Judge status: Accepted
N,K = map(int, input().split())
X = [int(i) for i in input().split()]

ans = float("inf")

for left in range(N-K+1):
    right = left + K - 1

    if X[left] <=0 and X[right] <= 0:
        cur = abs(X[left])
    elif X[left] >= 0 and X[right] >= 0:
        cur = abs(X[right])
    else:
        if abs(X[left]) >= abs(X[right]):
            cur = abs(X[right]) * 2 + abs(X[left])
        else:
            cur = abs(X[left]) * 2 + abs(X[right])
    ans = min(ans, cur)

print(ans)
# Judge status: Accepted
N=int(input())
abc=[list(map(int,input().split())) for i in range(N)]
x,y,z = 0,0,0
for a,b,c in abc:
    x,y,z = max(y,z)+a,max(x,z)+b,max(x,y)+c
print(max(x,y,z))
# Judge status: Accepted
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()

# 求解処理
N = len(S)
ans = 0
ACGT = ["A", "C", "G", "T"]
for i in range(N):
    if S[i] not in ACGT:
        continue
    length = 1
    for j in range(i + 1, N):
        if S[j] not in ACGT:
            break
        length += 1
    ans = max(ans, length)

# 結果出力
print(ans)
# Judge status: Accepted
import string
s = set(input())
alp = sorted(string.ascii_lowercase,reverse=True)
ans = 'None'
for i in alp:
    if not i in s:
        ans = i
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if( 500*a + 100*b + 50*c == X): count += 1

print(count)
# Judge status: Accepted
r,g,b = map(int,input().split())
if((g*10+b) % 4 == 0):
  print('YES')
else:
  print('NO')
# Judge status: Accepted
A,B,C=map(int,input().split())
K=int(input())
count=0
if B<=A:    
    while B<=A:
        B*=2
        count+=1
if count>K:
    print('No')
else:
    C*=2**(K-count)
    if C>B:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
from collections import Counter
import math
import statistics
import itertools
# a,b=map(int,input().split())
b=list(input())
# c=[]
# for i in a:
#     c.append(int(i))
# A,B,C= map(int,input().split())
# f = list(map(int,input().split()))
#g = [list(map(lambda x: '{}'.format(x), list(input()))) for _ in range(a)]
# h = []
# for i in range(a):
#     h.append(list(map(int,input().split())))
# a = [[0] for _ in range(H)]#nizigen
# lis=[input() for i in range(a)]


lis=list(set(b))
print(len(b)-len(lis))
# Judge status: Wrong Answer
n = int(input())
s = 0

for i in range(n):
    if (i%3==0) or (i%5==0):
        s = s
    else:
        s = s + i

print (s)
# Judge status: Accepted
n,m = map(int, input().split())

if n == m:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,m=map(int,input().split())
i=1
x=[]
while(i*i<=m):
    if(m%i==0):
        x.append(i)
        x.append(m//i)
    i+=1
x.sort()
for xi in x:
    if(xi>=n):
        print(m//xi)
        break
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for index,aa in enumerate(a):
  ans[aa-1] = index+1
print(*ans)
# Judge status: Accepted
#python3
from collections import deque
def main():
    n = int(input())
    a = [int(input())-1 for _ in range(n)]

    Q = deque()
    Q.append(a[0])
    
    cnt = 1
    flag = False
    for _ in range(n):
        x = Q.popleft()
        if x == 1:
            flag = True
            break
        cnt += 1
        Q.append(a[x])

    if not flag:
        print(-1)
    else:
        print(cnt)
main()
# Judge status: Accepted

[X,Y] = list(map(int,input().split()))

n = (-1*X+2*Y)//3
m = (2*X-Y)//3

if (X+Y)%3 !=0:
    print(0)

elif n<0 or m<0:
    print(0)

else:
    MAXN = (10**6)+10
    MOD = 10**9 + 7
    f = [1]
    for i in range(MAXN):
        f.append(f[-1] * (i+1) % MOD)
    def nCr(n, r, mod=MOD):
        return f[n] * pow(f[r], mod-2, mod) * pow(f[n-r], mod-2, mod) % mod


    print(nCr(n+m,n,10**9 + 7))
# Judge status: Accepted
N = int(input())
csf = [list(map(int, input().split())) for i in range(N - 1)]

for i in range(N):
    ans = 0
    for c, s, f in csf[i::]:
        if ans <= s:
            ans = s
        else:
            if ans % f == 0:
                pass
            else:
                ans = (ans // f + 1) * f
        ans += c
    print(ans)
# Judge status: Wrong Answer
n,m, k = map(int, input().split())

bo = False
for  i in range(1,n+1):
    for j in range(1,m+1):
        if i*(m-j) + j*(n-i) == k:
            bo = True

if bo :
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, x = map(int, input().split())

if x < a or x-a > b:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
s=list(input())
k=int(input())

for i in range(k):
    if s[i]!="1":
        print(s[i])
        break
    elif i==k-1:
        print(s[i])
        break
# Judge status: Accepted
a, b, k = list(map(int, input().split()))
l = []
for i in range(1,min(a,b)+1):
    if a%(i) == 0 and b%(i) == 0:
        l.append(i)
print(l[-(k)])
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(K):
    s = [0] * N
    e = [0] * N

    for j in range(N):
        s[max(j - A[j], 0)] += 1
        e[min(j + A[j], N-1)] += 1

    cur = 0
    for j in range(N):
        cur += s[j]
        A[j] = cur
        cur -= e[j]

    if s[0] == N and e[N-1] == N:
        break

print(' '.join(map(str, A)))
# Judge status: Accepted
import sys
import copy
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b = map(int, input().split())
s = input().split("-")

if len(s) == 2 and len(s[0]) == a and len(s[1]) == b:
    print('Yes')
    sys.exit()
else: print('No')
# Judge status: Wrong Answer
N = int(input())
CSFlist = [list(map(int, input().split())) for _ in range(N-1)]
def calc_time(start):
    now = 0
    for i in range(start, N-1):
        C, S, F = CSFlist[i]
        now = max(now, C)
        if now % F != 0:
            now += F - now % F
        now += C
    return now
for _ in range(N-1):
    print(calc_time(_))
print(0)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

import numpy as np

c=np.cumsum(a)
s=sum(a)

ans=float('inf')
index=0
for i in range(n):
    if abs(2*c[i]-s)<ans:
        ans=abs(2*c[i] - s)
        index = i

print(ans)
# Judge status: Accepted
s = int(input())
a = [s]

def func(n):
  if n % 2 == 0:
    a.append(n//2)
  elif n % 2 == 1:
    a.append(3*n + 1)
  
i = 1
while True:
  func(a[-1])
  i += 1
  if a.count(a[-1]) == 2:
    break
  else:
    pass


print(i)
# Judge status: Accepted
s = input()
n = len(s)
sa = s[:(n-1)//2]
sb = s[(n+3)//2-1:n]
if s == s[::-1] and sa == sa[::-1] and sb == sb[::-1]:
    print("Yes")
else:
    print("No")