Harryxun/stf_run huggingface dataset:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

res = 200
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        ans = i

print(ans + 1)

### FIXED CODE ###

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

res = abs(a - (t - h[0] * 0.006))
ans = 1
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        ans = i + 1

print(ans)
#151c
n,w=map(int,input().split())
ac=0
wa=[0]*w
wa_cnt=0
ac_flg=[0]*n
for i in range(w):
	p,s=input().split()
	p=int(p)-1
	if ac_flg[p]==1:
		continue
	else:
		if s=='AC':
			ac_flg[p]=1
			ac+=1
			wa[p] =wa_cnt
			wa_cnt=0
		else:
			wa_cnt+=1

wa_ans=0
for i in (n):
	wa_ans+=wa[i]
print(ac,wa_ans)

### FIXED CODE ###

#151c
n,w=map(int,input().split())
ac=0
wa=[0]*n
wa_cnt=[0]*n
ac_flg=[0]*n
for i in range(w):
	p,s=input().split()
	p=int(p)-1
	if ac_flg[p]==1:
		continue
	else:
		if s=='AC':
			ac_flg[p]=1
			ac+=1
			wa[p] =wa_cnt[p]
			#wa_cnt=0
		else:
			wa_cnt[p]+=1

wa_ans=0
for i in range(n):
	wa_ans+=wa[i]

print(ac,wa_ans)
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    A=list(map(int,input().split()))
    val=max(A)
    val2=0
    minabs=10**10
    for i in range(n):
        if abs(A[i]-(val//2))<minabs:
            minabs=abs(A[i]-(val//2))
            val2=A[i]
    print(val,val2)    



    
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():


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

        


    route = []
    for h in range(H):
        if h % 2 == 0:
            route.extend([(h, w) for w in range(W)])
        else:
            route.extend([(h, w) for w in reversed(range(W))])
    
    ans=[[0]*W for _ in range(H)]
    val=1
    i=0
    cnt=0
    for i in range(N):
        for j in range(A[i]):
            ans[route[cnt][0]][route[cnt][1]]=i+1
            cnt+=1
    for i in ans:
        print(*i)



resolve()
x, n = map(int, input().split())
p = list(map(int, input().split()))

if n == 0:
    ans = x

d = float('inf')

for i in range(n+1):
    tmpx = x + 1 + n//2 - i
    if not tmpx in p:
        tmpd = abs(x -tmpx) 
        if d >= tmpd:
            d = tmpd
            if ans > tmpx
                ans = tmpx

print(ans)




### FIXED CODE ###

x, n = map(int, input().split())
p = list(map(int, input().split()))

if n == 0:
    ans = x
else:
    ans = float('inf')

d = float('inf')

for i in range(n+2):
    tmpx = x + 1 + n//2 - i
    if not tmpx in p:
        tmpd = abs(x -tmpx) 
        if d >= tmpd:
            d = tmpd
            if ans >= tmpx:
                ans = tmpx

print(ans)
n,k = map(int,input().split(" "))
p = list(map(int,input().split(" "))).sort()
ans = 0

for i in range(k):
    ans = ans + p[i]

print(ans)

### FIXED CODE ###

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

p.sort()
#print(p)

ans = 0
for i in range(k):
    ans = ans + p[i]

print(ans)
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
# f=[0for _ in range(k+1)]
# for i in range(k+1):
#     for j in range(n):
#         f[i]+=a[j]^i
# f.sort(key=lambda x:-x)
a.sort(key=lambda x:-x)
powSize=math.ceil(math.log(k)/math.log(2))+1
digitCnt=[0for _ in range(powSize)]
for i in range(n):
    for j in range(powSize):
        if ( a[i]&(1<<j) )>0:
            digitCnt[j]+=1
# ansNum=[0]
# for i in range(powSize-1,-1,-1):
#     if 2*digitCnt[i]<n: # digitCnt[i]<n-digitCnt[i]
#         for j in range(len(ansNum)):
#             ansNum[j]+=(1<<i)
#             if ansNum[j]>k:
#                 if ( ansNum[j]&(1<<(i+1)) )>0:
#                     ansNum.append(ansNum[j]-(1<<(i+1)))
#                 ansNum[j]-=(1<<i)
    # print(i,ansNum)

ansNum=[0for _ in range(powSize)]
for i in range(powSize):
    ansNum[i]=( k&(((1<<powSize)-1)<<(i+1)) )
    for j in range(i):
        if 2*digitCnt[j]<n:
            ansNum[i]+=(1<<j)

ans=[0for _ in range(len(ansNum))]
for i in range(n):
    for j in range(len(ansNum)):
        if ansNum[j]<=k:
            ans[j]+=(a[i]^ansNum[j])
# print(a[0],powSize)
# print(digitCnt)
# print(ansNum,ans)
ans.sort(key=lambda x:-x)
print(ans[0])


### FIXED CODE ###

import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
# f=[0for _ in range(k+1)]
# for i in range(k+1):
#     for j in range(n):
#         f[i]+=a[j]^i
# f.sort(key=lambda x:-x)
a.sort(key=lambda x:-x)
powSize=math.ceil(math.log(k+1)/math.log(2))
digitCnt=[0for _ in range(powSize)]
for i in range(n):
    for j in range(powSize):
        if ( a[i]&(1<<j) )>0:
            digitCnt[j]+=1
ansNum=[0]
for i in range(powSize-1,-1,-1):
    if 2*digitCnt[i]<n: # digitCnt[i]<n-digitCnt[i]
        for j in range(len(ansNum)):
            ansNum[j]+=(1<<i)
            if ansNum[j]>k:
                if ( ansNum[j]&(1<<(i+1)) )>0:
                    ansNum.append(ansNum[j]-(1<<(i+1)))
                ansNum[j]-=(1<<i)
    # print(i,ansNum)

# ansNum=[0for _ in range(powSize)]
# for i in range(powSize):
#     ansNum[i]=( k&(((1<<powSize)-1)<<(i+1)) )
#     for j in range(i):
#         if 2*digitCnt[j]<n:
#             ansNum[i]+=(1<<j)

ans=[0for _ in range(len(ansNum))]
for i in range(n):
    for j in range(len(ansNum)):
        if ansNum[j]<=k:
            ans[j]+=(a[i]^ansNum[j])
# print(a[0],powSize)
# print(digitCnt)
# print(ansNum,ans)
ans.sort(key=lambda x:-x)
print(ans[0])
num = int(sys.stdin.readlines())
ans = num　** 3
print ans

### FIXED CODE ###

import sys
num = int(sys.stdin.readline())
ans = num ** 3
print ans
X, Y, Z, K = map(int, input().split())

A = map(int, input().split())
B = map(int, input().split())
C = map(int, input().split())


def get_good(a, v):
    if v is not None:
        return max(a[a < v])
    else:
        max(a)


value = 0
a = b = c = None
for i in range(K):
    print(get_good(A, a) + get_good(B, b), get_good(C, c))
    a = get_good(a)
    b = get_good(b)
    c = get_good(c)


### FIXED CODE ###

from heapq import heappush, heappop

X, Y, Z, K = map(int, input().split())

A = sorted([int(e) for e in input().split()], reverse=True)
B = sorted([int(e) for e in input().split()], reverse=True)
C = sorted([int(e) for e in input().split()], reverse=True)


def get_value(ai, bi, ci):
    return -(A[ai] + B[bi] + C[ci])


heap = []
heappush(heap, (get_value(0, 0, 0), 0, 0, 0))
used = {(0, 0, 0)}

for k in range(K):
    v, ia, ib, ic = heappop(heap)
    print(-v)

    if ia + 1 < X and (ia + 1, ib, ic) not in used:
        heappush(heap, (get_value(ia + 1, ib, ic), ia + 1, ib, ic))
        used.add((ia + 1, ib, ic))
    if ib + 1 < Y and (ia, ib + 1, ic) not in used:
        heappush(heap, (get_value(ia, ib + 1, ic), ia, ib + 1, ic))
        used.add((ia, ib + 1, ic))
    if ic + 1 < Z and (ia, ib, ic + 1) not in used:
        heappush(heap, (get_value(ia, ib, ic + 1), ia, ib, ic + 1))
        used.add((ia, ib, ic + 1))
num = [1, 9, 7, 4]
for i in a:
    if i not in a:
        print("NO")
        break
    else:
        num.remove(i)
        if len(num) == 0:
            print("YES")

### FIXED CODE ###

a = [int(i) for i in input().split()] 
b = []
for i in a:
    if i in [2, 3, 5, 6, 8]:
        print("NO")
        break
    elif i in b:
        print("NO")
        break
    else:
        b.append(i)
        if len(b) == 4:
            print("YES")
a = input()

if a >= 3200:
    print('pink')

elif a < 3200:
    print('red')

### FIXED CODE ###

a = int(input())
s = input()

if a < 3200:
    print('red')

else:
    print(s)
n = int(input())
a = sorted(list(map(int, input().split())))
if n % 2 == 1:
    for i in range(0, n, 2):
        if i == 0 and a[i] != 0:
            print(0)
            exit()
        elif a[i] != a[i + 1] or a[i] != 2 * i:
            print(0)
            exit()
else:
    for i in range(0, n, 2):
        if a[i] != a[i + 1] or a[i] != 2 * i + 1:
            print(0)
            exit()
print(2 ** (n // 2))

### FIXED CODE ###

import collections
n = int(input())
a = list(map(int, input().split()))
dd = collections.defaultdict(int)
correct = []
if n % 2 == 1:
    correct.append(0)
    for i in range((n - 1) // 2):
        correct.append(2 * i + 2)
        correct.append(2 * i + 2)
else:
    correct.append(1)
    correct.append(1)
    for i in range(n // 2):
        correct.append(2 * i + 3)
        correct.append(2 * i + 3)
a.sort()
correct.sort()
for i in range(n):
    if a[i] != correct[i]:
        print(0)
        exit()
for i in range(n):
    dd[str(a[i])] += 1
ans = 1
for k in dd.keys():
    if dd[k] >= 2:
        ans *= 2
        ans %= 10 ** 9 + 7
print(ans)
n=int(input())
a=list(map(int,input().split()))
 
count=0
ans=a[0]
for i in range(n):
  count=0
  while(a[i]%2==0):
    a[i]=a[i]//2
    count+=1
  ans=min(ans,count)
  
print(ans)

### FIXED CODE ###

n=int(input())
print(n%9)
S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    try:
        c=y[count]
    except IndexError:
        print(1)
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)

### FIXED CODE ###

S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5+1):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
ans=[]
for i in range(n):
	ans.append(a-abs(t−h[i]×0.006))
print(min(ans))

### FIXED CODE ###

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
ans=[]
for i in range(n):
	ans.append(abs(t-h[i]*0.006-a))
print(ans.index(min(ans))+1)
from operator import itemgetter
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))
b = []
for _ in range(m):
    tb, tc = map(int, input().split())
    b.append([tb, tc])
a.sort()
b.sort(key=itemgetter(1), reverse=True)

c = 0
flag = True
for j in range(m):
    for i in range(b[j][0]):
        if (a[c] < b[j][1]):
            a[c] = b[j][1]
            c += 1
            continue
        flag = False
    if (flag):
        continue
    break
print(sum(a))

### FIXED CODE ###

from operator import itemgetter
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = list(map(int, input().split()))
b = []
for _ in range(m):
    tb, tc = map(int, input().split())
    b.append([tb, tc])
a.sort()
b.sort(key=itemgetter(1), reverse=True)

c = 0
flag = False
for j in range(m):
    if (flag):
        break
    for i in range(b[j][0]):
        if (c >= len(a) or a[c] >= b[j][1]):
            flag = True
            break
        a[c] = b[j][1]
        c += 1

print(sum(a))
n=input()
cnt=0
for i in range(1,n+1):
  if i%3==0 or i%5==0:
    cnt+=0
  else:
    cnt+=i
print(cnt)


### FIXED CODE ###

n=int(input())
cnt=0
for i in range(1,n+1):
  if i%3==0 or i%5==0:
    cnt+=0
  else:
    cnt+=i
print(cnt)
s = int(input())
c = 0
a = [s]
while c < 100000:
  if s % 2 == 0:
    s = s//2
    c += 1
  else:
    s = 3*s+1
    c += 1
    a += [s]
  for i in range(c):
    if a[i] in a[:i]:
      print(i+1)
      exit()

### FIXED CODE ###

s = int(input())
a = []
while s not in a:
  a.append(s)
  if s%2 == 0:
    s = s/2
  else:
    s = 3*s+1
print(len(a)+1)
A,B,K=map(int,input().split())
n=1
while K>1:
  n+=1
  if A%n==0 and B%==0:
    K-=1
print(n)

### FIXED CODE ###

A,B,K=map(int,input().split())
k=0
n=min(A,B)
while 1:
  if A%n==0 and B%n==0:
    k+=1
  if K==k:
    break
  n-=1
print (n)
from math import ceil
n = int(input())
arr = list(map(int, input().split()))
B = []
for i in range(n):
    B.append(arr[i] - (i+1))
B.sort()
b1 = B[n//2]
b2 = B[int(ceil(n/2))]
ans1, ans2 = 0, 0
for i in range(n):
    ans1 += abs(arr[i]-(b1+i+1))
    ans2 += abs(arr[i]-(b2+i+1))
print (min(ans1, ans2))

### FIXED CODE ###

from math import ceil
n = int(input())
arr = list(map(int, input().split()))
B = []
for i in range(n):
    B.append(arr[i] - (i+1))
B.sort()
b1 = B[n//2]
b2 = B[n//2]
if n > 1:
	b2 = B[int(ceil(n/2))]
ans1, ans2 = 0, 0
for i in range(n):
    ans1 += abs(arr[i]-(b1+i+1))
    ans2 += abs(arr[i]-(b2+i+1))
print (min(ans1, ans2))
# -*- coding: utf-8 -*-
b = int(input())
c = b.split('')
a = c[-1]
if (a == '2' || a== '4' || a=='5' || a == '7' || a == '9'){
	print("hon")
}else if(a == '0' || a== '1' || a=='6' || a == '8'){
	print("pon")
}else {
  print("bon")
}

### FIXED CODE ###

b = int(input())
a = b % 10
if a ==2 or a== 4 or a==5 or a== 7 or a== 9:
	print("hon")
elif a == 0 or a== 1 or a==6 or a == 8:
	print("pon")
else:
  print("bon")
n = int(input())
h = [int(x) for x in input().split(" ")]
 
for i in range(1, n):
  if h[-i]-h[-i-1] >= 0:
    continue  
  elif h[-i]-h[-i-1] == -1:
    h[-i-1] = h[i-1] - 1
    continue
  elif h[i]-h[-i-1] < -1:
    ans = "No"
    break
else:
  ans = "Yes"
 
print(ans)

### FIXED CODE ###

a, b, c = [int(x) for x in input().split(" ")]
 
rest = a - b
ans = c - rest
if ans < 0:
  ans = 0
 
print(ans)
N=int(input())
s=[0]*N
for i in range(N):
  s[i] = int(input())
s.sort()
s_sum=sum(s)

if s_sum%10 !=0:
  ans = s_sum
else:
  for num in s:
    if (s_sum-num)%10 !=0:
      maxi_1 = s_sum-num
      #print(num,maxi_1)
      break
    else:
      maxi_1=0
  tmp=0
  for num in s:
    tmp += num
    if (s_sum-tmp)%10 !=0:
      maxi_2= s_sum-tmp
      #print(num,maxi_2)
      break
    else:
      maxi_2=0
    ans=max(maxi_1,maxi_2)
print(ans)

### FIXED CODE ###

N=int(input())
s=[0]*N
for i in range(N):
  s[i] = int(input())
s.sort()
s_sum=sum(s)

if s_sum%10 !=0:
  ans = s_sum
else:
  for num in s:
    if (s_sum-num)%10 !=0:
      maxi_1 = s_sum-num
      #print(num,maxi_1)
      break
    else:
      maxi_1=0
  tmp=0
  for num in s:
    tmp += num
    if (s_sum-tmp)%10 !=0:
      maxi_2= s_sum-tmp
      #print(num,maxi_2)
      break
    else:
      maxi_2=0
  ans=max(maxi_1,maxi_2)
print(ans)
import math

n, k = map(int, input().split())
a = list(map(int, input().split()))
num = 2 ** (max(int(math.log2(max(a))) + 1, int(math.log2(k + 0.0001)) + 1))
for i in range(n):
    a[i] = bin(a[i] + num)[3:]
binary = [[i,0,0] for i in range(int(math.log2(num)))]
for i in range(n):
    for j in range(int(math.log2(num))):
        if a[i][j] == "0":
            binary[int(math.log2(num)) - j - 1][1] += 1
        else:
            binary[int(math.log2(num)) - j - 1][2] += 1
binary.sort(reverse = True)
ans = 0
check = 0
for i in range(len(binary)):
    if binary[i][1] > binary[i][2]:
        check += 2 ** binary[i][0]
        if check <= k:
            ans += binary[i][1] * (2 ** binary[i][0])
        else:
            check -= 2 ** binary[i][0]
            ans += binary[i][2] * (2 ** binary[i][0])
    else:
        ans += binary[i][2] * (2 ** binary[i][0])
print(ans)

### FIXED CODE ###

import math

n, k = map(int, input().split())
a = list(map(int, input().split()))
num = 2 ** (max(int(math.log2(max(a))) + 1, int(math.log2(k + 0.0001)) + 1))
num2 = int(math.log2(num))
for i in range(n):
    a[i] = bin(a[i] + num)[3:]
binary = [[i,0,0] for i in range(num2)]
for i in range(n):
    for j in range(num2):
        if a[i][j] == "0":
            binary[num2 - j - 1][1] += 1
        else:
            binary[num2 - j - 1][2] += 1
binary.sort(reverse = True)
ans = 0
check = 0
for i in range(len(binary)):
    if binary[i][1] > binary[i][2]:
        check += 2 ** binary[i][0]
        if check <= k:
            ans += binary[i][1] * (2 ** binary[i][0])
        else:
            check -= 2 ** binary[i][0]
            ans += binary[i][2] * (2 ** binary[i][0])
    else:
        ans += binary[i][2] * (2 ** binary[i][0])
print(ans)
X, N = map(int, input().split(" "))
data = list(map(int, input().split(" ")))
point = 0
i = -1
while(1):
    if x not in data:
        print(x)
        break
    elif x+i not in data:
        print(x+i)
        break
    elif x+(-1*i) not in data:
        print(x+(-1*i))
        break
    else:
        i=i-1

### FIXED CODE ###

x, N = map(int, input().split(" "))
try:
  data = list(map(int, input().split(" ")))
except:
  data = []
point = 0
i = 0
while(1):
    if x not in data:
        print(x)
        break
    elif x+i not in data:
        print(x+i)
        break
    elif x+(-1*i) not in data:
        print(x+(-1*i))
        break
    else:
        i=i-1
X = list(map(int, input().split()))
X = sort()

print(X[0]*X[1]/2)

### FIXED CODE ###

X = list(map(int, input().split()))
X.sort()

print(int(X[0]*X[1]/2))
n,k,q = map(int,input().split(" "))
point = [k-q] * n
for i in range(0,q):
    point[int(input())-1] += 1
for j in range(0,n):
    if point[j] > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

S = input()

if S == "Sunny":
    result = "Cloudy"
elif S == "Cloudy":
    result = "Rainy"
else:
    result = "Sunny"

print(result)
n = int(input())
p = list(map(int, input().split(' ')))
p = sorted(p, reverse=True)
if len(p) != n or n < 4:
  raise ValueError

if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split(' ')))
p = sorted(p, reverse=True)
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')
a,b,c = map(input().split(), int)
if a+c == 2*b:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+c == 2*b:
	print('YES')
else:
	print('NO')
while True:
    n, x = map(int, raw_input().split())
    if n == 0 and x == 0:
        break

    count = 0
    for i in range(1, n-2):
        for j in range(i, n-1):
            k in range(j, n):
                if i+j+k == n:
                    count += 1
    print count

### FIXED CODE ###

while True:
    n, x = map(int, raw_input().split())
    if n == 0 and x == 0:
        break

    count = 0
    for i in range(1, n-1):
        for j in range(i+1, n):
            for k in range(j+1, n+1):
                if i+j+k == x:
                    count += 1
    print count
n,x= map(int,input().split())
L = list(map(int,input().split()))


coordinate=0
i=0
while(coordinate<=x):
    coordinate+=L[i]
    i+=1

print(i)

### FIXED CODE ###

#coding:utf-8
n,x= map(int,input().split())
L = list(map(int,input().split()))


coordinate=0
ans = 1
for e in L:
    if coordinate+e<=x:
        ans+=1
        coordinate+=e
    else:
        break

print(ans)
a,b=map(int,input().split())
c=int(500*a-b)
if c >0:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

a,b=map(int,input().split())
c = int(500*a-b)
if c >=0:
  print("Yes")
else:
  print("No")
print(input()**3)



### FIXED CODE ###

print(int(input())**3)
n=int(input())
A=[]
for i in range(n):
  a,b,c=map(int,input().split())
  if a<b+c or (b+c)%2!=a%2:
    print("No")
    exit()
if n==1:
  print("Yes")
  exit()
for i in range(n-2):
  if not A[i+1][0]-A[i][0]>=A[i+1][2]+A[i+1][1]-A[i][1]-A[i][2]:
    print("No")
    exit()
print("Yes")
    
      
  


### FIXED CODE ###

n=int(input())
A=[]
for i in range(n):
  a,b,c=map(int,input().split())
  if a<b+c or (b+c)%2!=a%2:
    print("No")
    exit()
  A.append([a,b,c])
if n==1:
  print("Yes")
  exit()
for i in range(n-1):
  if not A[i+1][0]-A[i][0]>=A[i+1][2]+A[i+1][1]-A[i][1]-A[i][2]:
    print("No")
    exit()
print("Yes")
n,m = [int(i) for i in input().split()]
A=[]
b=[]
for i in range(m):
	A.append([int(j) for j in inpur().split()])
for i in range(m):
	b.append(int(input()))
for i in range(n):
	s = 0
	for j in range(m):
		s+=A[i][j]*b[j]
	print(s)

### FIXED CODE ###

a,b=map(int,input().split())
A=[]
B=[]
for i in range(a):
	A.append([int(j) for j in input().split()])

for i in range(b):
	B.append(int(input()))


for i in range(a):
	s=0
	for j in range(b):
		s+=A[i][j]*B[j]
	print(s)
import sys

A, B, C, X, Y = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5]
A = int(A)                                                                                                         │chou@HEROZnoMacBook-Pro:~$ pyhton test.py 1 2 3 4 5
B = int(B)                                                                                                         │-bash: pyhton: command not found
C = int(C)                                                                                                         │chou@HEROZnoMacBook-Pro:~$ python test.py 1 2 3 4 5
X = int(X)                                                                                                         │1 2 3 4 5
Y = int(Y)                                                                                                         │chou@HEROZnoMacBook-Pro:~$ python test.py 1500 2000 1900 3 2


strat1 = A*X + B*Y  # simple strategy
strat2 = 2*C*X + abs(Y-X)+B  # more A, add back B
strat3 = 2*C*Y + abs(X-Y)*A  # more B, add back A
strat4 = 2*C*max(X,Y) # overbuy C

print min(strat1, strat2, strat3, strat4)


### FIXED CODE ###

A, B, C, X, Y = map(int, raw_input().split())

strat1 = A*X + B*Y  # simple strategy
strat2 = 2*C*X + abs(Y-X)*B  # more A, add back B
strat3 = 2*C*Y + abs(X-Y)*A  # more B, add back A
strat4 = 2*C*max(X,Y) # overbuy C

print min(strat1, strat2, strat3, strat4)