problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03617
u048176319
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\nc_05 = min(2*Q, H)\nc_1 = min(2*c_05, S)\n\nif c_1 <= D:\n print(c_1 * N)\nelse:\n if N % 2 == 0:\n print(D * (N//2))\n else:\n print(D * (N//2) + c_1)', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\nc_05 = min(2*Q, H)\nc_1 = min(2*c_05, S)\n\nif 2*c_1 <= D:\n print(c_1 * N)\nelse:\n if N % 2 == 0:\n print(D * (N//2))\n else:\n print(D * (N//2) + c_1)']
['Wrong Answer', 'Accepted']
['s067970627', 's312159230']
[3060.0, 3060.0]
[17.0, 18.0]
[222, 224]
p03617
u068142202
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\ncheep_1 = min(q * 4, 2 * h, s)\nif 2 * cheep_1 <= d:\n print(cheep_1 * n)\nelse:\n n1 = n % 2\n print(n // 2 + n1 * cheep_1)\n', 'q, h, s, d = map(int, input().split())\nn = int(input())\ncheep_1 = min(q * 4, 2 * h, s)\nif 2 * cheep_1 <= d:\n print(cheep_1 * n)\nelse:\n n1 = n % 2\n print(n // 2 * d + n1 * cheep_1)\n']
['Wrong Answer', 'Accepted']
['s352876854', 's741160241']
[9096.0, 9168.0]
[33.0, 27.0]
[185, 189]
p03617
u075303794
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['import sys\ninput = sys.stdin.readline\n\nQ,H,S,D = map(int, input().split())\nH = min(H, 2*Q)\nS = min(S, 2*H)\n\nN=int(input())\nanswer = 0\nif N&1:\n answer +=5\nD = min(D, 2*S)\nanswer += (N//2)*D', 'import sys\ninput = sys.stdin.readline\n\nQ,H,S,D = map(int, input().split())\nH = min(H, 2*Q)\nS = min(S, 2*H)\n\nN=int(input())\nanswer = 0\nif N&1:\n answer +=5\nD = min(D, 2*S)\nanswer += (N//2)*D', 'import sys\ninput = sys.stdin.readline\n\nQ,H,S,D = map(int, input().split())\nH = min(H, 2*Q)\nS = min(S, 2*H)\n\nN=int(input())\nanswer = 0\nif N&1:\n answer +=5\nD = min(D, 2*S)\nanswer += (N//2)*D\nprint(answer)', 'import sys\ninput = sys.stdin.readline\n\nQ,H,S,D = map(int, input().split())\n\nH = min(H, 2*Q)\nS = min(S, 2*H)\nD = min(D, 2*S)\n\nN = int(input())\nanswer = 0\n\nif N&1:\n answer += S\n\nanswer += (N//2)*D\nprint(answer)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s153627070', 's255591992', 's849699230', 's032593329']
[3060.0, 3060.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 18.0]
[189, 189, 203, 209]
p03617
u089230684
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['a,b,c,d=map(int, input().split)\nn=int(input)\noneltr=min(4*a, 2*b, c, 2*a+b)\ntwoltr=min(8*a, 4*b, 2*c, d, c+2*b, c+b+2*a,c+4*a,4*a+2*b,b+6*a,3*b+2*a)\n\nif(n%2==0) :\n print(n//2*twoltr)\nelse :\n print(oneltr+(n-1)//2*twoltr)\n', 'a,b,c,d=map(int,input().split())\nn=int(input())\n\ntwoval=min(8*a,4*a+2*b,4*b,2*b+c,2*c,d)\noneval=min(4*a,2*b,2*a+b,c)\n\nif n%2==0:\n print(twoval*(n//2))\nelse:\n print(oneval+twoval*((n-1)//2))\n \n']
['Runtime Error', 'Accepted']
['s085812018', 's746497460']
[3060.0, 3060.0]
[18.0, 18.0]
[258, 201]
p03617
u099918199
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = map(int, input().split())\nn = int(input())\nq_perf = q / 0.25\nh_perf = h / 0.5\ns_perf = s\nd_perf = d / 2\nlist_amo = [0.25,0.5,1.0,2.0]\nlist_price = [q,h,s,d]\nlist_perf = [q_perf,h_perf,s_perf,d_perf]\ncost = 0\nind4 = list_perf.index(min(list_perf))\nind3 = list_perf.index(min(list_perf[0:3]))\nind2 = list_perf.index(min(list_perf[0:2]))\nind1 = list_perf.index(min(list_perf[0:1]))\n\nwhile n >= 2:\n cost += int((n//int(list_amo[ind4])) * int(list_price[ind4]))\n n -= (n//list_amo[ind4]) * list_amo[ind4]\n\nwhile n >= 1:\n cost += int((n//int(list_amo[ind3])) * int(list_price[ind3]))\n n -= (n//list_amo[ind3]) * list_amo[ind3]\nwhile n >= 0.5:\n cost += int((n//list_amo[ind2]) * list_price[ind2])\n n -= (n//list_amo[ind2]) * list_amo[ind2]\n\nwhile n >= 0.25:\n cost += int((n//list_amo[ind1]) * list_price[ind1])\n n -= (n//list_amo[ind1]) * list_amo[ind1]\n\nprint(int(cost))\n', 'q,h,s,d = map(int, input().split())\nn = int(input())\nq_perf = q / 0.25\nh_perf = h / 0.5\ns_perf = s\nd_perf = d / 2\nlist_amo = [0.25,0.5,1,2]\nlist_price = [q,h,s,d]\nlist_perf = [q_perf,h_perf,s_perf,d_perf]\ncost = 0\nind4 = list_perf.index(min(list_perf))\nind3 = list_perf.index(min(list_perf[0:3]))\nind2 = list_perf.index(min(list_perf[0:2]))\nind1 = list_perf.index(min(list_perf[0:1]))\n\nwhile n >= 2:\n cost += int((n//list_amo[ind4]) * int(list_price[ind4]))\n n -= (n//list_amo[ind4]) * list_amo[ind4]\nwhile n >= 1:\n cost += int((n//list_amo[ind3]) * int(list_price[ind3]))\n n -= (n//list_amo[ind3]) * list_amo[ind3]\nwhile n >= 0.5:\n cost += int((n//list_amo[ind2]) * list_price[ind2])\n n -= (n//list_amo[ind2]) * list_amo[ind2]\n\nwhile n >= 0.25:\n cost += int((n//list_amo[ind1]) * list_price[ind1])\n n -= (n//list_amo[ind1]) * list_amo[ind1]\n\nprint(int(cost))']
['Runtime Error', 'Accepted']
['s709249288', 's827628337']
[3064.0, 3064.0]
[17.0, 17.0]
[903, 887]
p03617
u102126195
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['money = list(map(int, input().split()))\nif money[0] * 2 < money[1]:\n money[0] *= 4\n del money[1]\nelse:\n money[1] * 2\n del money[0]\nif money[0] < money[1]:\n del money[1]\nelse:\n del money[0]\nif money[0] * 2 < money[1]:\n money[1] = money[0] * 2\nN = int(input())\nprint(N // 2 * money[1] + N % 2 * money[0])\n', 'money = list(map(int, input().split()))\nif money[0] * 2 < money[1]:\n money[0] *= 4\n del money[1]\nelse:\n money[1] *= 2\n del money[0]\nif money[0] < money[1]:\n del money[1]\nelse:\n del money[0]\nif money[0] * 2 < money[1]:\n money[1] = money[0] * 2\nN = int(input())\nprint(N // 2 * money[1] + N % 2 * money[0])\n']
['Wrong Answer', 'Accepted']
['s451007109', 's452969067']
[3064.0, 3064.0]
[18.0, 17.0]
[324, 325]
p03617
u118642796
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q,H,S,D = map(int,input().split())\nN = int(input()) \n\nC = min(4*Q,2*H,S)\nif 2*C<=S:\n print(N*C)\nelif N%2==0:\n print(N*S//2)\nelse:\n print((N//2)*S+C)\n', 'Q,H,S,D = map(int,input().split())\nN = int(input()) \n\nC = min(4*Q,2*H,S)\nif 2*C<=D:\n print(N*C)\nelif N%2==0:\n print(N*D//2) \nelse:\n print((N//2)*D+C)\n']
['Wrong Answer', 'Accepted']
['s554083393', 's645122673']
[2940.0, 2940.0]
[17.0, 17.0]
[159, 161]
p03617
u136395536
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q,H,S,D = (int(i) for i in input().split())\nN = int(input())\n\nQper025L = Q\nHper025L = H / 2\nSper025L = S / 4\nDper025L = D / 8\n\nteainfo = [["Q",Qper025L,Q,0.25],["H",Hper025L,H,0.50],["S",Sper025L,S,1],["D",Dper025L,D,2]]\n\nsortedtea = sorted(teainfo, key = lambda x:(x[1],x[2]), reverse = False)\n\nprice = 0\n\nfor i in range(4):\n if sortedtea[i][3] <= N:\n numbottles = N // sortedtea[i][3]\n N -= sortedtea[i][3] * numbottles\n price += sortedtea[i][2] * numbottles\n\nprint(price)', 'Q,H,S,D = (int(i) for i in input().split())\nN = int(input())\n\nQper025L = Q\nHper025L = H / 2\nSper025L = S / 4\nDper025L = D / 8\n\nteainfo = [["Q",Qper025L,Q,0.25],["H",Hper025L,H,0.50],["S",Sper025L,S,1],["D",Dper025L,D,2]]\n\nsortedtea = sorted(teainfo, key = lambda x:(x[1],x[2]), reverse = False)\n\nprice = 0\n\nfor i in range(4):\n if sortedtea[i][3] <= N:\n numbottles = int(N / sortedtea[i][3])\n N -= sortedtea[i][3] * numbottles\n price += sortedtea[i][2] * numbottles\n\nprint(int(price))']
['Wrong Answer', 'Accepted']
['s568932142', 's797480497']
[3064.0, 3064.0]
[17.0, 17.0]
[498, 507]
p03617
u141574039
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q,H,S,D=map(int,input().split())\no=Q*8;h=H*4;s=S*2;d=D\nN=int(input())\nA=[0]*4;p=0;q=N\n\nA=[[0.25,Q,o],[0.5,H,h],[1,S,s],[2,D,d]]\nA.sort(key=lambda x: x[2])\n\n#print(A)\n\ni=0\nwhile q>0:\n if q%A[i][0]==0:\n p=p+(q//A[i][0])*A[i][1]\n q=q-(q//A[i][0])*A[i][0]\n break\n else:\n p=p+(q//A[i][0])*A[i][1]\n q=q-(q//A[i][0])*A[i][0]\n i=i+1\n\nprint(p)', 'Q,H,S,D=map(int,input().split())\no=Q*8;h=H*4;s=S*2;d=D\nN=int(input())*100\nA=[0]*4;p=0;q=N\n \nA=[[25,Q,o],[50,H,h],[100,S,s],[200,D,d]]\nA.sort(key=lambda x: x[2])\n \n#print(A)\n \ni=0\nwhile q>0:\n if q%A[i][0]==0:\n p=p+(q//A[i][0])*A[i][1]\n q=q-(q//A[i][0])*A[i][0]\n break\n else:\n p=p+(q//A[i][0])*A[i][1]\n q=q-(q//A[i][0])*A[i][0]\n i=i+1\n \nprint(int(p))']
['Wrong Answer', 'Accepted']
['s003596309', 's889232026']
[3064.0, 3064.0]
[17.0, 18.0]
[355, 369]
p03617
u163421511
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\n\nans = n//2*min(8*q, 4*h, 2*s, d) + min(4*q, 2*h, s)*(n%2!==0)\nprint(ans)\n', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\nans = n//2*min(8*q, 4*h, 2*s, d) + min(4*q, 2*h, s)*(n%2!=0)\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s854780827', 's337177364']
[8856.0, 9152.0]
[28.0, 29.0]
[130, 129]
p03617
u190405389
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['a = input()\ntotal = 1 + (len(a) * (len(a) - 1) // 2)\n\nfor i in range(len(a)):\n for j in range(i + 1, len(a)):\n if a[i] == a[j]:\n total -= 1\n\nprint(total)\n', 'a = input()\ntotal = 1 + (len(a) * (len(a) - 1) // 2)\n\nfor i in range(len(a)):\n for j in range(i + 1, len(a)):\n if a[i] == a[j]:\n total -= 1\n\nprint(total)', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\nx = min(4 * q, 2 * d, s)\n\nif n % 2 == 0:\n print(min(x, d // 2) * n)\nelif 2 * x < d:\n print(x * n)\nelse:\n print(d * (n // 2) + x)\n', 'a=input()\nl=len(a)\nb=1+(l*(l-1)//2)\nfor i in range(97,123):\n c=a.count(chr(i))\n d=(c*(c-1))//2\n b-=d\nprint(b)', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\nx = min(4 * q, 2 * h, s)\n\nif n % 2 == 0:\n print(min(x * n, n // 2 * d))\nelif 2 * x < d:\n print(x * n)\nelse:\n print(d * (n // 2) + x)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s527639426', 's734077275', 's748657862', 's858884737', 's952241053']
[3064.0, 2940.0, 3060.0, 2940.0, 3060.0]
[18.0, 17.0, 17.0, 18.0, 17.0]
[175, 174, 195, 118, 199]
p03617
u218984487
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\n\nN = int(input())\nans = 0\nQ *= 4\nH *= 2\ntwiceQ = Q * 2\ntwiceH = H * 2\ntwiceS = S * 2\n\na = N % 2\nif a == 0:\n num = N / 2\n ans += num * min(twiceQ, twiceH, twiceS, D)\nelse:\n num = (N-1) / 2\n ans += num * min(twiceQ, twiceH, twiceS, D)\n ans += min(Q, H, S)\nprint(ans)\n', 'Q, H, S, D = map(int, input().split())\n\nN = int(input())\nans = 0\n\nQ *= 4\nH *= 2\ntwiceQ = Q * 2\ntwiceH = H * 2\ntwiceS = S * 2\n\na = N % 2\nif a == 0:\n num = N // 2\n ans += num * min(twiceQ, twiceH, twiceS, D)\nelse:\n num = (N-1) // 2\n ans += num * min(twiceQ, twiceH, twiceS, D)\n ans += min(Q, H, S)\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s907584629', 's340362442']
[3316.0, 3316.0]
[19.0, 24.0]
[319, 323]
p03617
u221345507
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D=map(int,input().split())\nN=int(input())\nQ_1liter=4*Q\nH_1liter=2*H\nS_1liter=S\nmin_QHS=min(Q_1liter,H_1liter,S_1liter)\nmin_QHS2=min(min_QHS*2,D)\nif N%2==0:\n output=min_QHS2*(N/2)\n print(output)\nelse:\n output=((N-1)/2)*min_QHS2+min_QHS\n print(output)', 'Q, H, S, D=map(int,input().split())\nN=int(input())\nQ_1liter=4*Q\nH_1liter=2*H\nS_1liter=S\nmin_QHS=min(Q_1liter,H_1liter,S_1liter)\nmin_QHS2=min(min_QHS*2,D)\nif N%2==0:\n output=min_QHS2*int(N/2)\n print(int(output))\nelse:\n output=(int(N/2)*min_QHS2+min_QHS)\n print(int(output))']
['Wrong Answer', 'Accepted']
['s797724375', 's179884363']
[3064.0, 3064.0]
[17.0, 17.0]
[270, 284]
p03617
u225528554
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['def main():\n rt = 0\n Q,H,S,D = map(int,input())\n N = float(input())\n count_1 = N//2\n count_2 = (N-count_1)//1\n count_3 = (N-count_1-count_2)*100//50\n count_4 = (((N-count_1-count_2)*100)-50*count_3)//25\n if count_1:\n rt+=count_1*min(2*S,D,4*H,8*Q)\n if count_2:\n rt+=count_2*min(S,2*H,4*Q)\n if count_3:\n rt+=min(2*H,Q)*count_3\n if count_4:\n rt+=Q*count_4\n print(rt)\n\nif __name__=="__main__":\n main()', 'def main():\n rt = 0\n Q,H,S,D = map(int,input().split(" "))\n N = float(input())\n count_1 = N//2\n count_2 = (N-count_1*2)//1\n count_3 = (N-count_1*2-count_2)*100//50\n count_4 = (((N-count_1*2-count_2)*100)-50*count_3)//25\n if count_1:\n rt+=count_1*min(2*S,D,4*H,8*Q)\n if count_2:\n rt+=count_2*min(S,2*H,4*Q)\n if count_3:\n rt+=min(2*H,Q)*count_3\n if count_4:\n rt+=Q*count_4\n print(rt)\n\nif __name__=="__main__":\n main()', 'def main():\n rt = 0\n Q,H,S,D = map(int,input().split(" "))\n N = float(input())\n count_1 = N//2\n count_2 = (N-count_1)//1\n count_3 = (N-count_1-count_2)*100//50\n count_4 = (((N-count_1-count_2)*100)-50*count_3)//25\n if count_1:\n rt+=count_1*min(2*S,D,4*H,8*Q)\n if count_2:\n rt+=count_2*min(S,2*H,4*Q)\n if count_3:\n rt+=min(2*H,Q)*count_3\n if count_4:\n rt+=Q*count_4\n print(rt)\n\nif __name__=="__main__":\n main()', 'def main():\n rt = 0\n Q,H,S,D = map(int,input().split(" "))\n N = float(input())\n count_1 = N//2\n count_2 = (N-count_1*2)//1\n count_3 = (N-count_1*2-count_2)*100//50\n count_4 = (((N-count_1*2-count_2)*100)-50*count_3)//25\n if count_1:\n rt+=int(count_1)*min(2*S,D,4*H,8*Q)\n if count_2:\n rt+=int(count_2)*min(S,2*H,4*Q)\n if count_3:\n rt+=min(H,2*Q)*int(count_3)\n if count_4:\n rt+=Q*int(count_4)\n print(int(rt))\n\nif __name__=="__main__":\n main()']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s217611699', 's771772385', 's780113833', 's426038457']
[3064.0, 3064.0, 3064.0, 3188.0]
[17.0, 17.0, 17.0, 20.0]
[464, 482, 475, 507]
p03617
u226108478
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
["# -*- coding: utf-8 -*-\n\n\ndef main():\n q, h, s, d = map(int, input().split())\n n = int(input())\n ans = 0\n\n if n % 2 == 0:\n ans = min(4 * q, 2 * h, s, d / 2) * n\n else:\n ans = min(4 * q, 2 * h, s, d / 2) * (n - 1)\n ans += min(4 * q, 2 * h, s)\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "# -*- coding: utf-8 -*-\n\n\ndef main():\n q, h, s, d = map(int, input().split())\n n = int(input())\n ans = 0\n\n if n % 2 == 0:\n ans = min(8 * q, 4 * h, 2 * s, d) * (n // 2)\n else:\n ans = min(8 * q, 4 * h, 2 * s, d) * (n // 2)\n ans += min(4 * q, 2 * h, s)\n\n print(int(ans))\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s056543263', 's578670207']
[3060.0, 3060.0]
[19.0, 20.0]
[334, 347]
p03617
u227082700
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nn=int(input())\nh=min(q*2,h)\ns=min(s,h*2)\nprint(d*(n//2)+s*(n%2),s*n)', 'q,h,s,d=map(int,input().split())\nn=int(input())\nh=min(q*2,h)\ns=min(s,h*2)\nprint(min(d*(n//2)+s*(n%2),s*n))']
['Wrong Answer', 'Accepted']
['s646767969', 's787788085']
[2940.0, 2940.0]
[18.0, 17.0]
[101, 106]
p03617
u227888331
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['A = input("")\nnum = 1\nfor i in range(len(A)-1):\n\tnum += len(A[i+1:].replace(A[i],\'\'))\nprint(num)', 'from math import pi\n\ninput1 = list(map(int,input("").split(" ")))\nN = int(input(""))\nsrc = {"x":input1[0],"y":input1[1]}\ndist = {"x":input1[2],"y":input1[3]}\n\nspring = []\nfor i in range(N):\n\ttemp = list(map(int,input("").split(" ")))\n\tif temp[0] in range(min(src[\'x\'],dist[\'x\']),max(src[\'x\'],dist[\'x\'])+1):\n\t\tif temp[1] in range(min(src[\'y\'],dist[\'y\']),max(src[\'y\'],dist[\'y\'])+1):\n\t\t\tspring.append({\'x\':temp[0], \'y\':temp[1]})\n\n# print(spring)\npath = (abs(src[\'x\']-dist[\'x\']) + abs(src[\'y\']-dist[\'y\'])) * 100\nif len(spring) > 0:\n\tr = 10\n\tif src[\'x\'] == dist[\'x\'] or src[\'y\'] == dist[\'y\'] :\n\t\t\n\t\tpath += r*pi - 2*r \n\telse:\n\t\t\n\t\tif (src[\'x\']-dist[\'x\'])*(src[\'y\']-dist[\'y\']) > 0:\n\t\t\tspring.sort(key=lambda k: k[\'x\'])\n\t\telse:\n\t\t\tspring.sort(key=lambda k: k[\'x\'], reverse=True)\n\t\tL = [spring[0][\'y\']]\n\t\tlength = 1\n\t\tfor i in range(1,len(spring)):\n\t\t\tif L[length-1] < spring[i][\'y\']:\n\t\t\t\tL.append(spring[i][\'y\'])\n\t\t\t\tlength += 1\n\t\t\telse:\n\t\t\t\tfor j in range(length):\n\t\t\t\t\tif spring[i][\'y\'] <= L[j]:\n\t\t\t\t\t\tL[j] = spring[i][\'y\']\n\t\t\t\t\t\tbreak\n\t\tpath += (r*pi/2 - 2*r) * length\n\nprint(path)\n', 'input1 = input("").split(" ")\nQ = int(input1[0])\nH = int(input1[1])\nS = int(input1[2])\nD = int(input1[3])\nN = int(input(""))\n\nprint((N%2) * min(Q*4,H*2,S) + (N//2) * min(Q*8,H*4,S*2,D))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s133761255', 's443583211', 's252653840']
[2940.0, 3188.0, 3316.0]
[19.0, 19.0, 23.0]
[96, 1092, 185]
p03617
u243492642
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['# coding: utf-8\ndef II(): return int(input())\ndef ILI(): return list(map(int, input().split()))\n\n\ndef read():\n Q, H, S, D = ILI()\n N = II()\n return (Q, H, S, D, N)\n\n\ndef solve(Q, H, S, D, N):\n l_all = []\n l_all.append((Q * 4, "q"))\n l_all.append((H * 2, "h"))\n l_all.append((S, "s"))\n l_all.append((D / 2, "d"))\n l_all.sort(key= lambda x: x[0])\n ans = 0\n rest = N\n for i, j in l_all:\n if j == "q":\n div, mod = divmod(rest, 0.25)\n ans += div * Q\n rest = mod\n if j == "h":\n div, mod = divmod(rest, 0.5)\n ans += div * H\n rest = mod\n if j == "s":\n div, mod = divmod(rest, 1)\n ans += div * S\n rest = mod\n else:\n div, mod = divmod(rest, 2)\n ans += div * D\n rest = mod\n\n return ans\n\n\ndef main():\n params = read()\n print(solve(*params))\n\n\nif __name__ == "__main__":\n main()\n', '# coding: utf-8\ndef II(): return int(input())\ndef ILI(): return list(map(int, input().split()))\n\n\ndef read():\n Q, H, S, D = ILI()\n N = II()\n return (Q, H, S, D, N)\n\n\ndef solve(Q, H, S, D, N):\n l_all = []\n l_all.append((Q * 8, "q"))\n l_all.append((H * 4, "h"))\n l_all.append((S * 2, "s"))\n l_all.append((D, "d"))\n l_all.sort(key= lambda x: x[0])\n if N % 2 == 0:\n ans = (N // 2) * l_all[0][0]\n else:\n ans = (N // 2) * l_all[0][0]\n if l_all[0][1] != "d":\n ans += l_all[0][0] // 2\n else:\n ans += l_all[1][0] // 2\n return ans\n\n\ndef main():\n params = read()\n print(solve(*params))\n\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Accepted']
['s984038781', 's989869439']
[3316.0, 3444.0]
[21.0, 21.0]
[974, 707]
p03617
u277429554
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['a, b, c, d = map(int, input().split())\nn = int(input())\n \nb = min(a + a, b)\nc = min(b + b, c)\nd = min(c + c, d)\n \nq, r = divmod(N, 2)\nx = q * d + r * c\nprint(x)', 'a, b, c, d = map(int, input().split())\nn = int(input())\n \nb = min(a + a, b)\nc = min(b + b, c)\nd = min(c + c, d)\n \nq, r = divmod(n, 2)\nx = q * d + r * c\nprint(x)']
['Runtime Error', 'Accepted']
['s242171494', 's303647412']
[9044.0, 9180.0]
[28.0, 28.0]
[160, 160]
p03617
u280269055
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = int(input().strip().split())\nn = int(input())\n\nh = min(h, q*2)\ns = min(s, h*2)\nd = min(d, s*2)\n\nd_num, s_num = n//2, n%2\ncost = d_num*d + s_num*s\nprint(cost)', 'q,h,s,d = list(map(int, input().strip().split()))\nn = int(input())\n\nh = min(h, q*2)\ns = min(s, h*2)\nd = min(d, s*2)\n\nd_num, s_num = n//2, n%2\ncost = d_num*d + s_num*s\nprint(cost)']
['Runtime Error', 'Accepted']
['s305252543', 's839185712']
[3060.0, 3064.0]
[18.0, 17.0]
[167, 178]
p03617
u280984565
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['s = input()\n\ncount = 1\n\nalphabets = {}\n\nalphabets[s[0]] = 1\n\nfor i in range(1, len(s)):\n for char, char_count in alphabets.items():\n if char != s[i]:\n count += char_count\n\n if s[i] in alphabets:\n alphabets[s[i]] += 1\n else:\n alphabets[s[i]] = 1\n\nprint(count)\n', 's = input()\n\ncount = 1\n\nfor i in range(1, len(s)):\n ss = s[0:i]\n # print(ss, s[i])\n\n n = len(ss) - ss.count(s[i])\n count += n\n # print(n, count)\nprint(count)\n', 'def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]\n\nq, h, s, d = read_line(int, int, int, int)\nn, = read_line(int)\n\n# print(q, h, s, d)\n# print(n)\n\n# print()\n\nmenu = sorted({0.25: (q, q * 4), 0.5: (h, h * 2), 1: (s, s), 2: (d, d * 0.5)}.items(), key = lambda x: x[1][1])\n\n# print(list(menu))\n\ncharge = 0\nwhile True:\n for size, (price, _) in menu:\n if n >= size:\n count = int(n // size)\n charge += count * price\n n -= size * count\n if n == 0:\n print(int(charge))\n exit()\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s031540108', 's281418652', 's418216507']
[3060.0, 3064.0, 3064.0]
[18.0, 17.0, 18.0]
[300, 173, 568]
p03617
u284102701
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['b=list(map(int,input().split()))\nc = int(input())\nans = 0\nr = min([b[0]*4, b[1]*2, b[2]])\nr2 = min([r*2, b[3]])\n#if c % 2 == 1:\n# ans += r\n# c -= 1\n\n#print(int(ans))\n\nif c%2==1:\n\tprint(((c-1)/2)*r2+r)\nelse :\n\tprint((c/2)*r2)\n', 'a = input().split(" ")\nb = list(map(int, a))\nc = int(input())\nans = 0\nr = min([b[0] * 4, b[1] * 2, b[2]])\nr2 = min([r * 2, b[3]])\nif c % 2 == 1:\n ans += r\n c -= 1\nans += r2 * (c // 2)\nprint(int(ans))\n']
['Wrong Answer', 'Accepted']
['s394075166', 's663469975']
[3060.0, 3064.0]
[17.0, 17.0]
[250, 206]
p03617
u295524660
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = map(int,input().split())\nn = int(input())\na= min([q*4,h*2,s])\nb= min([a*2,d])\nprint(a+b*n//2)', 'q,h,s,d=map(int,input().split())\nn=int(input())\na=min(q*4,h*2,s)\nb=min(a*2,d)\nprint(a*(n%2)+b*(n//2))']
['Wrong Answer', 'Accepted']
['s588275172', 's294419050']
[3060.0, 3060.0]
[17.0, 17.0]
[103, 101]
p03617
u303019816
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\nd = [[2, 2/D, D], [1, 1/S, S], [0.5, 0.5/H, H], [0.25, 0.25/Q, Q]]\nd = sorted(d, key=lambda x: x[1])[::-1]\n\nans = 0\nfor i in range(4):\n amt, _, price = d[i]\n num = N // amt\n N -= num * amt\n ans += num * price\n\n if N == 0:\n print(ans)\n exit()\n', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\nH = min(H, 2 * Q)\nS = min(S, 2 * H)\nD = min(D, 2 * S)\nprint((N // 2) * D + (N % 2) * S)\n']
['Wrong Answer', 'Accepted']
['s333510921', 's028284110']
[3064.0, 2940.0]
[17.0, 17.0]
[328, 145]
p03617
u306142032
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nn=int(input())\na=min(q*4,h*2,s)\nb=min(q*8,h*4,s*2,d)\nprint(min(a*n,a*(n%2)+b*(n//2))', 'q,h,s,d=map(int,input().split())\nn=int(input())\na=min(q*4,h*2,s)\nb=min(q*8,h*4,s*2,d)\nprint(min(a*n,a*(n%2)+b*(n//2)))']
['Runtime Error', 'Accepted']
['s159638437', 's172376164']
[2940.0, 3060.0]
[17.0, 17.0]
[117, 118]
p03617
u306412379
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\narr = [4*Q*N, 2*H*N, S*N]\nif N % 2 == 0:\n arr.append(int(0.5*D*N))\nelif:\n if N >= 3:\n arr.append(int(0.5*D*(N-1)+ min(S, 2*H, 4*Q)))\n \nprint(min(arr))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\nx = N % 2\ny = N // 2\narr = [4*Q*x, 2*H*x, S*x]\narr1 = [8*Q*y, 4*H*y, 2*S*y, D*y]\n#if N % 2 == 0:\n# arr.append(int(0.5*D*N))\n#else:\n# arr.append(int(0.5*D*(N-1)+ min(S, 2*H, 4*Q)))\n \nprint(min(arr) + min(arr1))']
['Runtime Error', 'Accepted']
['s520998752', 's129737756']
[9028.0, 9136.0]
[24.0, 27.0]
[214, 269]
p03617
u314089899
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q,H,S,D = map(int, input().split())\nN = int(input())\nif N >=2:\n if N%2 == 0:\n ans = N/min([8*Q,4*H,2*S,D])\n else:\n ans = (N-1)/min([8*Q,4*H,2*S,D]) + min([4*Q,2*H,S])\nelse:\n ans = min([4*Q,2*H,S])\nprint(ans)', 'Q,H,S,D = map(int, input().split())\nN = int(input())\nif N >=2:\n if N%2 == 0:\n ans = N//2*min([8*Q,4*H,2*S,D])\n else:\n ans = (N-1)//2*min([8*Q,4*H,2*S,D]) + min([4*Q,2*H,S])\nelse:\n ans = min([4*Q,2*H,S])\nprint(ans)']
['Wrong Answer', 'Accepted']
['s996510461', 's447302799']
[9056.0, 9148.0]
[30.0, 31.0]
[230, 236]
p03617
u343128979
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['val = list(map(int, input().split()))\nN = int(input())\nprice = [v / (2 ** i) for i, v in enumerate(val)]\nsortedIndex = []\nsortedPrice = sorted(price)\nprice2 = price.copy()\nfor p in sortedPrice:\n sortedIndex.append(price2.index(p))\n price2[price2.index(p)] = -1\n\ntemp = 0\nans = 0\nfor i in sortedIndex:\n size = (0.25 * (2 ** i))\n times = int(N / size)\n print (size, times)\n N -= size * times\n ans += val[i] * times\n\n# while N > temp:\n# if(N < temp + 0.25 * (2 ** i)):\n# break\n# temp += 0.25 * (2 ** i)\n# ans += val[i]\n\nprint (ans)\n', 'val = list(map(int, input().split()))\nN = int(input())\nprice = [v / (2 ** i) for i, v in enumerate(val)]\nsortedIndex = []\nsortedPrice = sorted(price)\nprice2 = price.copy()\nfor p in sortedPrice:\n sortedIndex.append(price2.index(p))\n price2[price2.index(p)] = -1\n\ntemp = 0\nans = 0\nfor i in sortedIndex:\n size = (0.25 * (2 ** i))\n times = int(N / size)\n # print (size, times)\n N -= size * times\n ans += val[i] * times\n\n# while N > temp:\n# if(N < temp + 0.25 * (2 ** i)):\n# break\n# temp += 0.25 * (2 ** i)\n# ans += val[i]\n\nprint (ans)\n']
['Wrong Answer', 'Accepted']
['s343589942', 's675557026']
[3064.0, 3064.0]
[17.0, 17.0]
[615, 617]
p03617
u346395915
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = map(int,input().split())\nn = int(input())\n\ndic = {0.25:q*4, 0.5:h*2, 1:s, 2:d/2}\ndic_sorted = sorted(dic.items(),key=lambda x:x[1])\n\ntemp1 = n//dic_sorted[0][0]\ntemp2 = n%dic_sorted[0][0]\n\ncnt = temp2\nans = temp1 * dic_sorted[0][1]\n\nwhile cnt != 0:\n for i in range(4):\n if dic_sorted[i][0] <= cnt:\n cnt -= dic_sorted[i][0]\n ans += dic_sorted[i][1] * dic_sorted[i][0]\n break\n \nprint(int(ans))\n ', 'q,h,s,d = map(int,input().split())\nn = int(input())\n\nans = (n//2) * min(q*8, h*4, s*2, d) + (n%2) * min(q*4, h*2,s)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s740797827', 's411214763']
[3064.0, 2940.0]
[17.0, 17.0]
[468, 126]
p03617
u353919145
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['a,b,c,d=map(int, input().split)\nn=int(input)\noneltr=min(4*a, 2*b, c, 2*a+b)\ntwoltr=min(8*a, 4*b, 2*c, d, c+2*b, 4*a+2*b)\n\nif n%2==0 :\n print(twoltr*n//2)\nelse :\n print(oneltr+twoltr*(n-1)//2)\n', 'a,b,c,d=map(int, input().split())\nn=int(input())\noneltr=min(4*a, 2*b, c, 2*a+b)\ntwoltr=min(8*a, 4*b, 2*c, d, c+2*b, c+b+2*a,c+4*a,4*a+2*b,b+6*a,3*b+2*a)\n\nif n%2==0 :\n print(twoltr * (n//2))\nelse :\n print(oneltr+twoltr * ((n-1)//2))\n']
['Runtime Error', 'Accepted']
['s954167282', 's308429582']
[3060.0, 3060.0]
[17.0, 18.0]
[220, 260]
p03617
u357751375
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q,H,S,D = map(int,input().split())\nN = int(input())\nc = 0\n\nwhile N > 0:\n if N >= 2:\n c += D\n N -= 2\n if N >= 1:\n c += S\n N -= 1\n if N >= 0.5:\n c += H\n N -= 0.5\n if N >= 0.25:\n c += Q\n N -= 0.25\n\nprint(c)', 'q,h,s,d = map(int,input().split())\nn = int(input())\n\nz = min(q*4,h*2,s)\n\nif n % 2 != 0:\n print(min((n//2)*d+z,n*z))\nelse:\n print(min((n//2)*d,n*z))\n']
['Wrong Answer', 'Accepted']
['s981607949', 's417326738']
[2940.0, 9088.0]
[2104.0, 29.0]
[271, 154]
p03617
u367130284
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nn=int(input())\n#print(q,h,s,d)\ncosp=[[q*16,1],[h*4,1],[s,1],[d/2,2]]\nc=sorted(cosp,key=lambda x:x[0])\n#print(c)\ncost=0\nfor i in c:\n p,q=i[0],i[1]\n if n//q>0:\n cost+=(n//q)*p*q\n n-=(n//q)*q\nprint(int(cost))', 'q,h,s,d=map(int,input().split())\nn=int(input())\n#print(q,h,s,d)\ncosp=[[q*4,0.25],[h*2,0.5],[s,1],[d/2,2]]\nc=sorted(cosp,key=lambda x:x[0])\n#print(c)\ncost=0\nfor i in c:\n p,q=i[0],i[1]\n if n//q>0:\n cost+=(n//q)*p*q\n n-=(n//q)*q\nprint(cost)', 'q,h,s,d,n=map(int,open(0).read().split());m=min(4*q,2*h,s);print(n//2*min(d,2*m)+n%2*m)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s090164798', 's571589819', 's696906499']
[3064.0, 3064.0, 2940.0]
[18.0, 18.0, 18.0]
[258, 257, 87]
p03617
u373047809
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['*l, n = map(int, open(0).read().split())\nc = 0\nfor i, j in sorted([j*2**(2-i), 2**(i-2)] for i, j in enumerate(l)):\n t = n//j*j\n c += i*t\n n -= t\n if not n:\n print(c)\n exit()', 'q, h, s, d, n = map(int, open(0).read().split())\nm = min(q*4, h*2, s)\nprint(min(n*m, n//2*d + n%2*m))']
['Wrong Answer', 'Accepted']
['s872571942', 's062398613']
[3060.0, 2940.0]
[18.0, 19.0]
[184, 101]
p03617
u382030492
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['import numpy as np\n\nQ, H, S, D = map(int, input().split())\nvalues = np.array([min(min(2*Q, H), S), D])\n\ncapacities = np.array([1.0, 2.0])\neval = values / capacities\nN = int(input())\nnums = np.zeros(2)\n\nsorted_eval_index = np.argsort(eval)\n\n# N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n\n\nfor index in list(sorted_eval_index):\n if N/capacities[index] >= 1:\n nums[index] += int(N/capacities[index])\n N -= nums[index] * capacities[index]\n\nprint(int(np.sum(values*nums)))', 'import numpy as np\n\nQ, H, S, D = map(int, input().split())\n# values = np.array([min(2*min(2*Q, H), S), D])\n\n# capacities = np.array([1.0, 2.0])\n# eval = values / capacities\nN = int(input())\n\n#\n# sorted_eval_index = np.argsort(eval)\n#\n# # N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n\n#\n# for index in list(sorted_eval_index):\n# if N/capacities[index] >= 1:\n# nums[index] += int(N/capacities[index])\n# N -= nums[index] * capacities[index]\n#\n# print(int(np.sum(values*nums)))\n\nprint(int(N/2*(min(2*min(2*min(2*Q, H), S), D))+(N % 2)*(min(2*min(2*Q, H), S))))', 'import numpy as np\n\nQ, H, S, D = map(int, input().split())\nvalues = np.array([Q, H, S, D])\n\ncapacities = np.array([0.25, 0.5, 1.0, 2.0])\neval = values / capacities\nN = int(input())\nnums = np.zeros(4)\n\nsorted_eval_index = np.argsort(eval)\n\n# N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n\n\nN_last = N\n\nfor index in list(sorted_eval_index):\n if N/capacities[index] >= 1:\n nums[index] += int(N/capacities[index])\n N -= nums[index] * capacities[index]\n\nprint(np.sum(values*nums))', 'import numpy as np\n\nQ, H, S, D = map(int, input().split())\n# values = np.array([min(2*min(2*Q, H), S), D])\n\n# capacities = np.array([1.0, 2.0])\n# eval = values / capacities\nN = int(input())\n\n# \n# sorted_eval_index = np.argsort(eval)\n# \n# # N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n\n# \n# for index in list(sorted_eval_index):\n# if N/capacities[index] >= 1:\n# nums[index] += int(N/capacities[index])\n# N -= nums[index] * capacities[index]\n# \n# print(int(np.sum(values*nums)))\n\nprint(N/2*(min(2*min(2*min(2*Q, H), S), D))+(N % 2)*(min(2*min(2*Q, H), S)))', 'import numpy as np\n\nQ, H, S, D = map(int, input().split())\nvalues = np.array([min(min(2*Q, H), S), D])\n\ncapacities = np.array([1.0, 2.0])\neval = values / capacities\nN = int(input())\nnums = np.zeros(2)\n\nsorted_eval_index = np.argsort(eval)\n\nprint(capacities)\nprint(values)\nprint(sorted_eval_index)\n\n# N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n\n\nfor index in list(sorted_eval_index):\n if N/capacities[index] >= 1:\n nums[index] += int(N/capacities[index])\n N -= nums[index] * capacities[index]\n\nprint(int(np.sum(values*nums)))', 'import numpy as np\n\nQ, H, S, D = map(int, input().split())\n# values = np.array([min(2*min(2*Q, H), S), D])\n\n# capacities = np.array([1.0, 2.0])\n# eval = values / capacities\nN = int(input())\n\n#\n# sorted_eval_index = np.argsort(eval)\n#\n# # N = 0.25 * Q_n + 0.5 * H_n + 1 * S_n + 2 * D_n\n#\n# for index in list(sorted_eval_index):\n# if N/capacities[index] >= 1:\n# nums[index] += int(N/capacities[index])\n# N -= nums[index] * capacities[index]\n#\n# print(int(np.sum(values*nums)))\n\nprint(int(int(N/2)*(min(2*min(2*min(2*Q, H), S), D))+(N % 2)*(min(2*min(2*Q, H), S))))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s138537392', 's469210436', 's528335172', 's836896562', 's913853158', 's978783658']
[12424.0, 20240.0, 20372.0, 21136.0, 14424.0, 12420.0]
[149.0, 272.0, 312.0, 305.0, 151.0, 151.0]
[497, 610, 503, 609, 555, 615]
p03617
u403301154
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = list(map(int, input().split()))\nn = int(input())\nt = min(4*q, 2*h, s)\nif n%2==0:\n ans = min(n*t, n*(d/2))\nelse:\n ans = min((n-1)*t, (n-1)*(d/2))+t\nprint(ans)', 'q, h, s, d = list(map(int, input().split()))\nn = int(input())\nt1 = min(4*q, 2*h, s)\nt2 = min(2*t1, d)\nans = t2*(n//2)\nif n%2==1:\n ans += t1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s438625626', 's333678553']
[3060.0, 3068.0]
[18.0, 18.0]
[172, 151]
p03617
u411923565
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\n\nQ1,H1,S1 = 8*Q,4*H,2*S\nS = min(Q1,H1,S1)\n\n\nif 2*S>D:\n cnt_A = N//2\n cnt_B = N%2\n pay = a*cnt_A + (cnt_B/B)*(b/(2/B))\nelse:\n pay = (N//A) * (a/(2/A))\nprint(int(pay))', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\n\nQ1,H1,S1 = 8*Q,4*H,2*S\nS = min(Q1,H1,S1)\n\nif 2*S>D:\n cnt_A = N//2\n cnt_B = N%2\n pay = a*cnt_A + (cnt_B/B)*(b/(2/B))\nelse:\n pay = (N//A) * (a/(2/A))\nprint(int(pay))', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\nQ1,H1 = 4*Q,2*H\nS = min(Q1,H1,S)\n\nif 2*S>D:\n cnt_2 = N//2\n cnt_1 = N%2\n pay = a*cnt_2 + S*cnt_1\nelse:\n pay = N * S\nprint(int(pay))', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\n\nQ1,H1 = 4*Q,2*H\nS = min(Q1,H1,S)\n\nif 2*S>D:\n cnt_A = N//2\n cnt_B = N%2\n pay = a*cnt_A + (cnt_B/B)*(b/(2/B))\nelse:\n pay = (N//A) * (a/(2/A))\nprint(int(pay))', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\nQ1,H1 = 4*Q,2*H\nS = min(Q1,H1,S)\n\nif 2*S>D:\n cnt_2 = N//2\n cnt_1 = N%2\n pay = a*cnt_2 + S*cnt_1\nelse:\n pay = (N//A) * S\nprint(int(pay))', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\nQ1,H1 = 4*Q,2*H\nS = min(Q1,H1,S)\n\nif 2*S>D:\n cnt_2 = N//2\n cnt_1 = N%2\n pay = a*cnt_2 + S*cnt_1\nelse:\n pay = N * S\nprint(pay)', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\n\nQ2,H2,S2,D2 = 8*Q,4*H,2*S,D\nlis = [(0.25,Q2),(0.5,H2),(1,S2),(2,D)]\nlis = sorted(lis,reverse = False,key = lambda x:x[1])\n\na,b,c,d = lis[0][1],lis[1][1],lis[2][1],lis[3][1]\n\n\nA,B,C,D = lis[0][0],lis[1][0],lis[2][0],lis[3][0]\npay = 0\n\nif A == 2:\n cnt_A = N//2\n cnt_B = N%2\n pay = D*cnt_A + cnt_B*(b/(2/B))\nelse:\n pay = (N//a) * (a/(2/A))\nprint(int(pay))', 'Q,H,S,D = map(int,input().split())\nN = int(input())\n\n\nQ2,H2,S2,D2 = 8*Q,4*H,2*S,D\nlis = [(0.25,Q2),(0.5,H2),(1,S2),(2,D)]\nlis = sorted(lis,reverse = False,key = lambda x:x[1])\n\na,b,c,d = lis[0][1],lis[1][1],lis[2][1],lis[3][1]\n\n\nA,B,C,D = lis[0][0],lis[1][0],lis[2][0],lis[3][0]\nprint(lis)\n\npay = 0\n\ncnt = (N//A)\nN -= A*cnt\npay += (a/(2/A))*cnt\n\nif N == 1:\n cnt = (N//B)\n N -= B*cnt\n pay += (b/(2/B))*cnt\nprint(int(pay)) ', '#A - Ice Tea Store\nQ,H,S,D = map(int,input().split())\nN = int(input())\n\nQ1,H1 = 4*Q,2*H\nS = min(Q1,H1,S)\n\nif 2*S>D:\n cnt_2 = N//2\n cnt_1 = N%2\n pay = D*cnt_2 + S*cnt_1\nelse:\n pay = N * S\nprint(pay)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s069922981', 's358724812', 's546580104', 's764668274', 's778568700', 's797639223', 's814385548', 's976217626', 's963963898']
[9132.0, 9148.0, 9184.0, 9104.0, 9140.0, 9140.0, 9212.0, 9224.0, 9140.0]
[25.0, 24.0, 24.0, 27.0, 25.0, 29.0, 31.0, 28.0, 27.0]
[261, 260, 214, 252, 219, 209, 511, 520, 209]
p03617
u430928274
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\nans = 0\nq_per = q / 0.25\nh_per = h / 0.5\ns_per = s\nd_per = d / 2\nlist = [q_per,h_per,s_per,d_per]\nelif min(list) == d_per :\n if n%2 == 0:\n ans += d * (n //2)\n else :\n ans += n//2 * d\n n -= n//2\n list.remove(d_per)\n if min(list) == s_per :\n ans += s_per\n elif min(list) == h_per :\n ans += h * 2\n else :\n ans += q * 4\nelif min(list) == s_per :\n ans += n * s\nelif min(list) == h_per :\n ans += n * 2 * h\nelse :\n ans += n * 4 * q\n\nprint(int(ans))\n', 'q, h, s, d = map(int, input().split())\nn = int(input())\nans = 0\nq_per = q / 0.25\nh_per = h / 0.5\ns_per = s\nd_per = d / 2\nlist = [q_per,h_per,s_per,d_per]\nif min(list) == d_per :\n if n%2 == 0:\n ans += d * (n //2)\n else :\n ans += n//2 * d\n n -= n//2\n list.remove(d_per)\n if min(list) == s_per :\n ans += s_per\n elif min(list) == h_per :\n ans += h * 2\n else :\n ans += q * 4\nelif min(list) == s_per :\n ans += n * s\nelif min(list) == h_per :\n ans += n * 2 * h\nelse :\n ans += n * 4 * q\n\nprint(int(ans))\n']
['Runtime Error', 'Accepted']
['s518634985', 's776241466']
[8928.0, 9228.0]
[23.0, 33.0]
[595, 593]
p03617
u443170850
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['A = list(input())\nN = len(A)\nuq_list = []\nhalfN = N // 2\n\ncount = 1\nfor i in range(0, N):\n tempstr = A[i]\n for j in range(i+1, N):\n if A[j] != tempstr:\n count += 1\n\nprint(count)', 'Q, H, S, D = input().split()\nQ, H, S, D = int(Q), int(H), int(S), int(D) # price 0.25 0.5 1.0 2.0\nN = int(input())\n\nper_2l_price = [Q*8, H*4, S*2, D]\nper_1l_price = [Q*4, H*2, S]\nper_05_price = [Q*2, H]\nper_025_price = [Q]\nneedtobuy_l = N\nneedtobuy_m = 0\n\n\ndef st_min(lt):\n min_num = 0\n min_ = 1000000000000000000000000\n for i in range(len(lt)):\n if lt[i] < min_:\n min_num = i\n min_ = lt[i]\n return min_num\nst_min\n\n\nif needtobuy_l >= 2.0:\n mn = st_min(per_2l_price)\n needtobuy_m += per_2l_price[mn] * (needtobuy_l // 2.0)\n needtobuy_l -= 2.0 * (needtobuy_l // 2.0)\nprint(needtobuy_l, needtobuy_m)\ninput()\nif needtobuy_l >= 1.0:\n mn = st_min(per_1l_price)\n needtobuy_m += per_1l_price[mn] * (needtobuy_l // 1.0)\n needtobuy_l -= 1.0 * (needtobuy_l // 1.0)\nprint(needtobuy_l, needtobuy_m)\ninput()\nif needtobuy_l >= 0.5:\n mn = st_min(per_05_price)\n needtobuy_m += per_05_price[mn] * (needtobuy_l // 0.5)\n needtobuy_l -= 0.5 * (needtobuy_l // 0.5)\nprint(needtobuy_l, needtobuy_m)\ninput()\nif needtobuy_l >= 0.25:\n needtobuy_m += Q * (needtobuy_l // 0.25)\n needtobuy_l -= 0.25 * (needtobuy_l // 0.25)\n\nprint(int(needtobuy_m))\n', 'Q, H, S, D = input().split()\nQ, H, S, D = int(Q), int(H), int(S), int(D)\nN = int(input())\n\nneedtobuy_l = N\nneedtobuy_m = 0\nper_2l_price = [D,\n S*2, S+H*2, S+H+Q*2,\n H*4, H*3+Q*2, H*2+Q*4, H+Q*6,\n Q*8]\nper_1l_price = [S,\n H*2, H+Q*2,\n Q*4]\n\nprint(per_2l_price)\nprint(per_1l_price)\nif needtobuy_l % 2 == 0:\n mincost = min(per_2l_price)\n needtobuy_m = mincost * (needtobuy_l // 2)\nelse:\n mincost = min(per_2l_price)\n needtobuy_m = mincost * (needtobuy_l // 2)\n mincost = min(per_1l_price)\n needtobuy_m += mincost * 1\n\nprint(needtobuy_m)', 'Q, H, S, D = input().split()\nQ, H, S, D = int(Q), int(H), int(S), int(D)\nN = int(input())\n\nneedtobuy_l = N\nneedtobuy_m = 0\nper_2l_price = [D,\n S*2, S+H*2, S+H+Q*2,\n H*4, H*3+Q*2, H*2+Q*4, H+Q*6,\n Q*8]\nper_1l_price = [S,\n H*2, H+Q*2,\n Q*4]\n\nif needtobuy_l % 2 == 0:\n mincost = min(per_2l_price)\n needtobuy_m = mincost * (needtobuy_l // 2)\nelse:\n mincost = min(per_2l_price)\n needtobuy_m = mincost * (needtobuy_l // 2)\n mincost = min(per_1l_price)\n needtobuy_m += mincost * 1\n\nprint(needtobuy_m)']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s073799594', 's421414570', 's527564132', 's890243649']
[3060.0, 3064.0, 3064.0, 3064.0]
[17.0, 18.0, 17.0, 17.0]
[201, 1193, 626, 586]
p03617
u445624660
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['\nq, h, s, d = map(int, input().split())\nn = int(input())\narr = [8 * q, 4 * h, 2 * s, d]\nx = min(arr)\nans = (n // 2) * x\nprint(x, ans)\nif n / 2 > 0:\n ans += min([4 * q, 2 * h, s])\nprint(ans)\n', '\nq, h, s, d = map(int, input().split())\nn = int(input())\narr = [8 * q, 4 * h, 2 * s, d]\nx = min(arr)\nif n % 2 == 0:\n print((n // 2) * x)\nelse:\n ans = (n // 2) * x\n ans += min([4 * q, 2 * h, s])\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s269282129', 's585827605']
[3060.0, 3060.0]
[17.0, 17.0]
[226, 251]
p03617
u463655976
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['VS = [(Y, Y*(2/q), q) for Y, q in ((int(input()), q) for q in (0.25, 0.5, 1, 2))]\nN = int(input())\ntanka = 0\nfor Y, _, q in sorted(VS, key=lambda x:x[1], reverse=True):\n u = N // q\n N -= q * u\n tanka += Y * u\n if N <= 0:\n break\n\nprint(tanka)\n', 'VS = [(Y, Y*(2//q), q) for Y, q in zip(map(int, input().split()), (0.25, 0.5, 1, 2))]\nN = int(input())\n#print(VS)\ntanka = 0\nfor Y, _, q in sorted(VS, key=lambda x:x[1], reverse=False):\n u = N // q\n N -= q * u\n #print((q, u))\n tanka += Y * int(u)\n if N <= 0:\n break\n \nprint(tanka)']
['Runtime Error', 'Accepted']
['s657026859', 's367710886']
[3060.0, 3064.0]
[18.0, 17.0]
[249, 287]
p03617
u489959379
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
["import sys\n\nsys.setrecursionlimit(10 ** 7)\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n q, h, s, d = map(int, input().split())\n n = int(input())\n t = min(q * 4, h * 2, s)\n if n == 1:\n print(int(t))\n else:\n if n % 2 == 0:\n print(int(min(t * n, d * n // 2)))\n else:\n print(t * n, d * ((n - 1) // 2) + t)\n print(int(min(t * n, d * ((n - 1) // 2) + t)))\n\n\nif __name__ == '__main__':\n resolve()\n", "import sys\n\nsys.setrecursionlimit(10 ** 7)\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n q, h, s, d = map(int, input().split())\n n = int(input())\n t = min(q // 0.25, h // 0.5, s)\n\n if n == 1:\n print(t)\n else:\n if n % 2 == 0:\n print(min(t * n, d * n // 2))\n else:\n print(min(t * n, d * (n - 1) // 2 + t))\n\n\nif __name__ == '__main__':\n resolve()\n", "import sys\n\nsys.setrecursionlimit(10 ** 7)\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n q, h, s, d = map(int, input().split())\n n = int(input())\n t = min(q * 4, h * 2, s)\n\n if n == 1:\n print(int(t))\n else:\n if n % 2 == 0:\n print(int(min(t * n, d * n // 2)))\n else:\n print(int(min(t * n, d * ((n - 1) // 2) + t)))\n\n\nif __name__ == '__main__':\n resolve()\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s363993324', 's477885348', 's624877404']
[3064.0, 3060.0, 3064.0]
[17.0, 18.0, 17.0]
[474, 416, 426]
p03617
u494508938
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['A = input()\ncand = set([A])\nl = len(A)\nfor i in range(0, l - 1):\n for j in range(i + 1,l):\n p = A[i:j+1]\n cand.add((A[0:i] + p[::-1] + A[j + 1:l]))\nprint(len(cand))', 'A = input()\ncand = set([A])\nl = len(A)\nfor i in range(0, l - 1):\n for j in range(i + 1,l):\n p = A[i:j+1]\n cand.add((A[0:i] + p[::-1] + A[j + 1:l]))\nprint(len(cand))', "if __name__ == '__main__':\n\n Q, H, S, D = map(int, input().split())\n N = int(input())\n\n \n amounts = {'Q' : 0.25, 'H' : 0.5, 'D' : 1.0, 'D' : 2.0}\n \n sizes = {'Q' : int(Q * 4.0), 'H' : int(H * 2.0), 'S' : S, 'D' : int(D * 0.5)}\n sizes = sorted(sizes.items(), key=lambda x: x[1])\n print(sizes)\n sum_price = 0\n\n while N > 0:\n for size in sizes:\n\n if size[0] != 'D':\n if N - 1 >= 0:\n N -= 1\n sum_price += size[1]\n else:\n break\n else:\n if N - 2 >= 0:\n N -= 2\n sum_price += D\n else: break\n\n\n\n print(sum_price)", "if __name__ == '__main__':\n Q, H, S, D = map(int, input().split())\n N = int(input())\n \n #amounts = {'Q' : 0.25, 'H' : 0.5, 'D' : 1.0, 'D' : 2.0}\n \n sizes = {'Q' : int(Q * 4.0), 'H' : int(H * 2.0), 'S' : S, 'D' : int(D * 0.5)}\n sizes = sorted(sizes.items(), key=lambda x: x[1])\n sum_price = 0\n while N > 0:\n for size in sizes:\n if size[0] != 'D':\n sum_price += size[1] * N\n N = 0\n else:\n num = int(N / 2)\n N -= 2 * num\n sum_price += D * num\n print(sum_price)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s354399419', 's442642663', 's526203844', 's225215303']
[3060.0, 3060.0, 3316.0, 3064.0]
[18.0, 18.0, 2104.0, 18.0]
[181, 181, 771, 642]
p03617
u514118270
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['import sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\ndef s(): return input()\ndef i(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef L(): return list(input().split())\ndef l(): return list(map(int,input().split()))\ndef lcm(a,b): return a*b//math.gcd(a,b)\nsys.setrecursionlimit(10 ** 9)\nmod = 10**9+7\n\nQ,H,S,D = I()\nN = i()\nA = [[Q*8,0.25,Q],[H*4,0.5,H],[S*2,1,S],[D,2,D]]\nA.sort()\nans = 0\nfor i in range(4):\n a,b,c = A.pop(0)\n if b <= N:\n ans += (N//b)*c\n N -= (N//b)*b\n if N == 0:\n print(ans)\n break\n', 'import sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\ndef s(): return input()\ndef i(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef L(): return list(input().split())\ndef l(): return list(map(int,input().split()))\ndef lcm(a,b): return a*b//math.gcd(a,b)\nsys.setrecursionlimit(10 ** 9)\nmod = 10**9+7\n\nQ,H,S,D = I()\nN = i()\nA = [[Q*8,0.25,Q],[H*4,0.5,H],[S*2,1,S],[D,2,D]]\nA.sort()\nans = 0\nfor i in range(4):\n a,b,c = A.pop(0)\n if b <= N:\n ans += int((N//b)*c)\n N -= (N//b)*b\n if N == 0:\n print(ans)\n break']
['Wrong Answer', 'Accepted']
['s451009989', 's435443660']
[5096.0, 5224.0]
[35.0, 35.0]
[676, 680]
p03617
u533039576
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\n\none = min(q * 4, h * 2, s)\ntwo = min(one, d)\n\nans = (n // 2) * two + (n % 2) * one\nprint(ans)\n', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\none = min(q * 4, h * 2, s)\ntwo = min(one * 2, d)\n\nans = (n // 2) * two + (n % 2) * one\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s786491092', 's579572866']
[9128.0, 8976.0]
[28.0, 27.0]
[151, 155]
p03617
u543954314
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = map(int,input().split())\nr = [q,h,s,d]\nn = int(input())\nl = [q,h/2,s/4,d/8]\ncost = 0\nwhile n:\n now = l2.index(min(l))\n cost += n//r[now]\n n %= r[now]\n r.pop(now)\n l.pop(now)\nprint(cost)', 'q,h,s,d = map(int,input().split())\nr = [q,h,s,d]\nn = int(input())*4\nl = [q,h/2,s/4,d/8]\nv = [1,2,4,8]\ncost = 0\nwhile n:\n now = l2.index(min(l))\n cost += n//v[now] * r[now]\n n %= v[now]\n v.pop(now)\n r.pop(now)\n l.pop(now)\nprint(cost)\n', 'q,h,s,d = map(int,input().split())\nr = [q,h,s,d]\nn = int(input())*4\nl = [q,h/2,s/4,d/8]\nv = [1,2,4,8]\ncost = 0\nwhile n:\n now = l.index(min(l))\n cost += n//v[now] * r[now]\n n %= v[now]\n v.pop(now)\n r.pop(now)\n l.pop(now)\nprint(cost)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s134944961', 's811627893', 's541750814']
[3064.0, 3064.0, 3064.0]
[19.0, 17.0, 17.0]
[200, 239, 237]
p03617
u547537397
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,re,d = map(int,input().split())\nn = int(input())\nre = min(q*4, h*2,result)\nprint(min(result*n, n//2*d + (n%2)*re))', 'q,h,re,d = map(int,input().split())\nn = int(input())\nre = min(q*4, h*2,re)\nprint(min(re*n, n//2*d + (n%2)*re))']
['Runtime Error', 'Accepted']
['s220609009', 's002285451']
[9148.0, 9084.0]
[27.0, 25.0]
[118, 110]
p03617
u616489782
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['price = [int(x) for x in input().split()];\nN = int(input());\nprice_d = price[3];\nprice_s = 2*price[2];\nprice_h = 4*price[1];\nprice_q = 8*price[0];\np = min([price_q,price_h,price_s]);\nif price_d < p :\n if N%2 == 1 :\n ans = (N-1)//2*price_d + p//2;\n else :\n ans = N//2*price_d;\nelse :\n ans = N*p//2;\n\nprint(ans));\n\n', 'price = [int(x) for x in input().split()];\nN = int(input());\nprice_d = price[3];\nprice_s = 2*price[2];\nprice_h = 4*price[1];\nprice_q = 8*price[0];\np = min([price_q,price_h,price_s]);\nif price_d < p :\n if N%2 == 1 :\n ans = (N-1)//2*price_d + p//2;\n else :\n ans = N//2*price_d;\nelse :\n ans = N*p//2;\n\nprint(ans);\n\n']
['Runtime Error', 'Accepted']
['s639590178', 's101433225']
[8952.0, 9176.0]
[29.0, 29.0]
[336, 335]
p03617
u623349537
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\nmost_bargain = min(8 * Q, 4 * H, 2 * S, D)\nif most_bargain != D:\n print((most_bargain // 2) * N)\nelse:\n if N % 2 == 0:\n print((N // 2) * D)\n else:\n print((N // 2) * D + min(4 * Q, 2 * H, S))5410760474836152\n1524157763907942', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\nmost_bargain = min(8 * Q, 4 * H, 2 * S, D)\nif most_bargain != D:\n print((most_bargain // 2) * N)\nelse:\n if N % 2 == 0:\n print((N // 2) * D)\n else:\n print((N // 2) * D + min(4 * Q, 2 * H, S))']
['Runtime Error', 'Accepted']
['s430590870', 's624103542']
[2940.0, 3060.0]
[19.0, 17.0]
[303, 270]
p03617
u623687794
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nn=int(input())\ncperl=[q*4,h*2,s,d/2]\nif n%2==0:\n print(n*min(cperl))\nelse:\n if min(cperl)==cperl[3]:\n print(cperl[3]*(n-1)+min(cperl[:3]))\n else:\n print(n*min(cperl))\n', 'q,h,s,d=map(int,input().split())\nn=int(input())\ncperl=[q*4,h*2,s,d//2]\nif n%2==0:\n print(n*min(cperl))\nelse:\n if min(cperl)==cperl[3]:\n print(cperl[3]*(n//2)+min(cperl[:3]))\n else:\n print(n*min(cperl))', 'q,h,s,d=map(int,input().split())\nn=int(input())\ncperl=[q*8,h*4,s*2,d]\nif n%2==0:\n print(int((n//2)*min(cperl)))\nelse:\n if min(cperl)==cperl[3]:\n print(int(cperl[3]*(n//2)+min(cperl[:3])//2))\n else:\n print(int(n*(min(cperl)//2)))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s557252691', 's830876437', 's648657182']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[209, 210, 238]
p03617
u624475441
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split()) # 0.25, 0.5, 1, 2\nN = int(input())\nH = min(H, 2 * Q) # 0.5\nS = min(S, 2 * H) # 1\nif 2 * S <= D:\n print(S * N)\nelse:\n if N % 2 == 0:\n print(D * N // 2)\n else:\n print(D * N // 2 + S)', 'q, h, s, d, n = map(int, open(0).read().split())\ns = min(q * 4, h * 2, s)\nprint(n // 2 * min(d, s * 2) + n % 2 * s)']
['Wrong Answer', 'Accepted']
['s650660252', 's773504233']
[3060.0, 2940.0]
[18.0, 18.0]
[247, 115]
p03617
u634046173
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\ncQ = Q*4\ncH = H*2\ncS = S\ncD = D / 2\n\nm = min(cQ, cH, cS, cD)\n\nif m == cQ:\n print(cQ * N)\nelif m == cH:\n print(cH * N)\nelif m == cS:\n print(cS * N)\nelse:\n if N % 2 == 0:\n print(D * N // 2)\n elif N == 1:\n print(min(cQ, cH, cS))\n else:\n c = (N-1)*cD\n print(c + min(cQ, cH, cS))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\ncQ = Q*8\ncH = H*4\ncS = S*2\ncD = D \n\nm = min(cQ, cH, cS, cD)\n\nif m == cQ:\n print(Q * N * 4)\nelif m == cH:\n print(H * N * 2)\nelif m == cS:\n print(S * N)\nelse:\n if N % 2 == 0:\n print(D * N // 2)\n elif N == 1:\n print(min(Q * 4, H * 2, S))\n else:\n c = (N-1) // 2 * D\n print(c + min(Q * 4, H * 2, S))\n']
['Wrong Answer', 'Accepted']
['s569952095', 's896926823']
[9212.0, 9132.0]
[27.0, 27.0]
[377, 398]
p03617
u652656291
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = map(int,input().split())\nn = int(input())\na = min(q*4,h*2,s)\nif n % 2 == 0:\n print(min(n/(a*2),n/d))\nelse:\n print(min(n/(a*2)+d),n/d)\n \n ', 'Q, T, S, D = map(int, input().split())\nN = int(input())\n\nfor_1L = min(4*Q, 2*T, S)\nfor_2L = min(2*for_1L, D)\n\nprint((N//2)*for_2L + (N%2)*for_1L)\n']
['Runtime Error', 'Accepted']
['s326374238', 's297265119']
[3060.0, 2940.0]
[18.0, 17.0]
[157, 146]
p03617
u657691939
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\n\ns = min(q*4, h*2, s)\n\nprint(s*n if d<s*2 else d*(n//2)+s)\n\n\n', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\ns = min(q*4, h*2, s)\n\nprint(s*n if d>s*2 else d*(n//2)+s*(n%2))\n\n\n']
['Wrong Answer', 'Accepted']
['s432737850', 's438297407']
[2940.0, 2940.0]
[17.0, 18.0]
[117, 123]
p03617
u665038048
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\nprint((n/2) * min(8 * q, 4 * h, 2 * s, d) + (n % 2) * min(4 * q, 2 * h, s))', 'q, h, s, d = map(int, input().split())\nn = int(input())\nprint((n//2) * min(8 * q, 4 * h, 2 * s, d) + (n % 2) * min(4 * q, 2 * h, s))']
['Wrong Answer', 'Accepted']
['s591339121', 's291192875']
[3060.0, 3060.0]
[20.0, 17.0]
[131, 132]
p03617
u668503853
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nN=int(input())\ns=min(q*4,h*2,s)\nprint(min(s*N,d*(N//2)+a*(N%2)))', 'q,h,s,d=map(int,input().split())\nN=int(input())\ns=min(q*4,h*2,s)\nprint(min(s*N,d*(N//2)+s*(N%2)))']
['Runtime Error', 'Accepted']
['s284786388', 's196895599']
[3060.0, 2940.0]
[18.0, 17.0]
[97, 97]
p03617
u680851063
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['l = [[0.25],[0.5],[1],[2]]\ntmp = list(map(int,input().split()))\nfor i in range(4):\n l[i].append(tmp[i])\n\nfor i in range(4):\n l[i].append(l[i][1]*4//(l[i][0]*4))\nprint(l)\n\nfrom operator import itemgetter\nl = sorted(l, key=itemgetter(2))\n\nans = 0\nn = int(input())\nfor i in range(4):\n tmp = n//l[i][0]\n if tmp > 0:\n ans += tmp * l[i][1]\n n -= tmp*l[i][0]\n\nprint(int(ans))', 'l = [[0.25],[0.5],[1],[2]]\ntmp = list(map(int,input().split()))\nfor i in range(4):\n l[i].append(tmp[i])\nprint(l)\nfor i in range(4):\n l[i].append(l[i][1]*4/(l[i][0]*4))\nprint(l)\n\nfrom operator import itemgetter\nl = sorted(l, key=itemgetter(2))\n\nans = 0\nn = int(input())\nfor i in range(4):\n tmp = n//l[i][0]\n if tmp > 0:\n ans += tmp * l[i][1]\n n -= tmp*l[i][0]\n\nprint(int(ans))', 'l = [[0.25],[0.5],[1],[2]]\ntmp = list(map(int,input().split()))\n\nfor i in range(4):\n l[i].append(tmp[i])\n\nfor i in range(4):\n l[i].append(l[i][1]*4/(l[i][0]*4))\n\nfrom operator import itemgetter\nl = sorted(l, key=itemgetter(2))\n\nans = 0\nn = 4*int(input())\nfor i in range(4):\n tmp = n//int(l[i][0]*4)\n if tmp >= 1:\n ans += tmp * l[i][1]\n n -= tmp*int(l[i][0]*4)\n\nprint(int(ans))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s249308055', 's498962261', 's425408197']
[9304.0, 9312.0, 9068.0]
[31.0, 27.0, 31.0]
[394, 401, 403]
p03617
u683134447
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['al = list(map(int,input().split()))\nbl = al[:]\nn = int(input())\n\nbl[0] = al[0] * 8\nbl[1] = al[1] * 4\nbl[2] = bl[2] * 2\n\nimport numpy as np\n\nt = list(np.argsort(bl))\nif t[3] == 0:\n idx = t.index(1)\n print(n//2 * bl[3] + (n%2) * bl[idx] / 2)\nelse:\n idx = t.index(0)\n print(n * bl[idx] / 2)\n\n', 'al = list(map(int,input().split()))\nn = int(input())\n\nbl = al[:]\nbl[0] = bl[0] * 4\nbl[1] = bl[1] * 2\nbl[2] = bl[2] * 1\nbl[3] = bl[3] / 2\n\nidx = bl.index(min(bl))\nidx2 = bl[:3].index(min(bl[:3]))\nif idx == 3:\n print(n//2*al[idx] + (n%2) * bl[idx2])\nelse:\n print(bl[idx]*n)']
['Wrong Answer', 'Accepted']
['s516890373', 's082405604']
[12480.0, 3064.0]
[149.0, 18.0]
[301, 277]
p03617
u690536347
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\nif N%2:\n if D/2 < min(Q*4, H*2, S):\n print(int(N//2*(D/2))+(N-N//2)*min(Q*4, H*2, S))\n else:\n print(N*min(Q*4, H*2, S))\nelse:\n print(int(N*min(Q*4, H*2, S, D/2)))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\nif N%2:\n if D/2 < min(Q*4, H*2, S):\n print(N//2*S+(N-N//2)*min(Q*4, H*2, S))\n else:\n print(N*min(Q*4, H*2, S))\nelse:\n print(int(N*min(Q*4, H*2, S, D/2)))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\nm1 = min(Q*4, H*2, S)\n\nif N%2:\n print(N//2*D+m1 if D < 2*m1 else N*m1)\nelse:\n print(N*min(Q*8, H*4, S*2, D)//2)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s324167182', 's816298772', 's910436740']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[242, 233, 173]
p03617
u703890795
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\nif N%2 == 0:\n print((N//2)*min(8*Q,4*H,2*S,D))\nelse:\n m = min(4*Q,2*H,S)\n if 2*m <= D:\n print(m*N)\n else:\n print((D/2)*N+m)', 'Q, H, S, D = map(int, input().split())\nN = int(input())\nif N%2 == 0:\n print((N//2)*min(8*Q,4*H,2*S,D))\nelse:\n m = min(4*Q,2*H,S)\n if 2*m <= D:\n print(m*N)\n else:\n print(int((D/2)*N+m))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\nif N%2 == 0:\n print(N * min(4*Q, 2*H, S, D/2))\nelse:\n print(min(4*Q*N, 2*H*N, S*N, N*D//2 + min(4*Q, 2*H, S)))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\nif N%2 == 0:\n print((N//2)*min(8*Q,4*H,2*S,D))\nelse:\n m = min(4*Q,2*H,S)\n if 2*m <= D:\n print(m*N)\n else:\n print(int(D*(N//2)+m))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s682278029', 's712291543', 's903609474', 's716543165']
[3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0, 17.0]
[189, 194, 168, 195]
p03617
u723583932
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['#AtCoder Grand Contest 019 a\nq,h,s,d=map(int,input().split())#0.25,0.5,1,2\nd=min(d,s*2,h*4,q*8)\ns=min(s,h*2,q*4)\nh=min(h,q*2)\nn=int(input())\nans=0\nn-=n//d\nans+=n//d*d\nn-=n//s\nans+=n//s*s\nn-=n//h\nans+=n//h*h\nn-=n//q\nans+=n//q*q\nprint(int(ans))\n', '#AtCoder Grand Contest 019 a\nq,h,s,d=map(int,input().split())#0.25,0.5,1,2\nd=min(d,s*2,h*4,q*8)\ns=min(s,h*2,q*4)\n\nn=int(input())\nif n%2==0:\n print(n//2*d)\nelse:\n print(n//2*d+s)\n']
['Wrong Answer', 'Accepted']
['s094592136', 's113446375']
[9128.0, 9052.0]
[28.0, 26.0]
[243, 184]
p03617
u740284863
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d = map(int,input().split())\nn = int(input())\nk = [\n [q*4,q,0.25],\n [h*2,h,0.5],\n [s,s,1],\n [d/2,d,2]\n ]\nk.sort() \ncost = 0\nfor i in range(4):\n num = n // k[i][2] * k[i][1]\n cost += num\n n %= k[i][2]\nprint(cost)', 'q,h,s,d = map(int,input().split())\nn = int(input())*4\n\nk = [\n [q*8,q,1],\n [h*4,h,2],\n [s*2,s,4],\n [d,d,8]\n ]\nk.sort() \ncost = 0\nfor i in range(4):\n num = n // k[i][2] * k[i][1]\n cost += num\n n %= k[i][2]\nprint(int(cost))\n']
['Wrong Answer', 'Accepted']
['s301242064', 's622804260']
[3064.0, 3064.0]
[18.0, 17.0]
[272, 393]
p03617
u747703115
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\nql = 4*q\nhl = 2*h\ndl = d/2\nprint(n//2*2*(min(ql, hl, s, dl))+n%2*min(ql, hl, s))', 'q, h, s, d = map(int, input().split())\nn = int(input())\nql = 4*q\nhl = 2*h\ndl = d/2\nif n%2==0:\n print(n*(min(ql, hl, s, dl)))\nelse:\n print((n-1)*(min(ql, hl, s, dl))+min(ql, hl, s))', 'q, h, s, d = map(int, input().split())\nn = int(input())\nprint(n//2*(min(8*q, 4*h, 2*s, d))+n%2*min(4*q, 2*h, s))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s472717208', 's909417292', 's986717367']
[3060.0, 3060.0, 2940.0]
[17.0, 18.0, 17.0]
[136, 186, 112]
p03617
u749512407
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q,H,S,D = map(int,input().spllit())\nN = int(input())\n\nh = min(2*Q,H)\ns = min(2*h,S)\nd = min(2*s,D)\n\nprint((N//2)*d + (N%2)*s)', 'Q,H,S,D = map(int,input().spllit())\nN = int(input())\n\nh = min(H , 2*Q)\ns = min(2*h,S)\nd = min(2*s,D)\n\nif N % 2 == 0:\n print((N//2 * d))\nelse:\n print((N//2)*d + s)', 'Q,H,S,D = map(int,input().spllit())\nN = int(input())\n\nh = min(H , 2*Q)\ns = min(2*h,S)\nd = min(2*s,D)\n\nprint((N//2)*d + (N%2)*s)', 'Q,H,S,D = map(int,input().spllit())\nN = int(input())\n\nh = min(H , 2*Q)\ns = min(2*h,S)\nd = min(2*s,D)\n\nif N % 2 == 0:\n print((N//2 * d))\nelse:\n print((N//2)*d + s)', 'Q,H,S,D = map(int,input().split())\nN = int(input())\nh = min(2*Q,H)\ns = min(2*h,S)\nd = min(2*s,D)\nprint((N//2)*d + (N%2)*s)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s105385741', 's298851343', 's477766356', 's549228400', 's761192026']
[3060.0, 3060.0, 3060.0, 3060.0, 2940.0]
[18.0, 18.0, 17.0, 18.0, 17.0]
[125, 164, 127, 164, 123]
p03617
u760761366
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['def sym(s): \n even = True if len(s)%2 == 0 else False \n \n if len(s) < 4: \n if even: \n f = s[:len(s)//2] \n l = s[len(s)//2:] \n \n return f == l[::-1] \n \n else: \n f = s[:len(s)//2] \n l = s[len(s)//2 + 1:] \n \n return f == l[::-1] \n else: \n if s[0] != s[-1]: \n return False \n else: \n return True \n \n \nA = input() \nL = len(A) \n \nr = range(L) \n \ncount = 1 \n \n \na = [sum([1 if not sym(A[i:j+1]) else 0 for j in r[i+1:]]) for i in r[:L-1]] \n\n# for j in r[i+1:]: \n\n# if not sym(s): \n# count += 1 \n \n#print(count) \nprint(sum(a)+1) ', 'Q, H, S, D = [int(i) for i in input().split()] \nN = int(input()) \n \nprice = [Q, H, S, D] \nvol = [0.25, 0.5, 1, 2] \nunit = [Q*4, H*2, S, D//2] \n \np = 0 \nidx = 4 \nwhile True: \n idx = unit.index(min(unit[:idx])) \n \n p += int(N / vol[idx]) * price[idx] \n N -= vol[idx]*int(N / vol[idx]) \n \n if N == 0: \n break; \n\nprint(int(p))']
['Wrong Answer', 'Accepted']
['s567697105', 's865743445']
[3064.0, 3064.0]
[17.0, 17.0]
[7806, 1663]
p03617
u762008592
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['a,b,c,d=[int(i) for i in input().split()]\nM=[4*a,2*b,c,d/2]\nN=int(input())\n\nif M[0]==min(M):\n print(N*M[0])\nelif M[1]==min(M):\n print(N*M[1])\nelif M[2]==min(M):\n print(N*M[2])\nelse:\n if N%2==0:\n print(int(N//2*int(M[3]*2))\n else:\n if M[0]==min([4*a,2*b,c]):\n print(N//2*int(M[3]*2)+M[0])\n elif M[1]==min([4*a,2*b,c]):\n print(N//2*int(M[3]*2)+M[1])\n elif M[2]==min([4*a,2*b,c]):\n print(N//2*int(M[3]*2)+M[2])\n', 'a,b,c,d=[int(i) for i in input().split()]\nM=[4*a,2*b,c,d/2]\nN=int(input())\n\nif M[0]==min(M):\n print(N*M[0])\nelif M[1]==min(M):\n print(N*M[1])\nelif M[2]==min(M):\n print(N*M[2])\nelse:\n if N%2==0:\n print(int(N*M[3]))\n else:\n if M[0]==min(M):\n print(N//2*int(M[3]*2)+M[0])\n elif M[1]==min(M):\n print(N//2*int(M[3]*2)+M[1])\n elif M[2]==min(M):\n print(N//2*int(M[3]*2)+M[2])\n', 'a,b,c,d=[int(i) for i in input().split()]\nM=[4*a,2*b,c,d/2]\nN=int(input())\n\nif M[0]==min(M):\n print(N*M[0])\nelif M[1]==min(M):\n print(N*M[1])\nelif M[2]==min(M):\n print(N*M[2])\nelse:\n if N%2==0:\n print(int(N//2*int(M[3]*2)))\n else:\n if M[0]==min([4*a,2*b,c]):\n print(N//2*int(M[3]*2)+M[0])\n elif M[1]==min([4*a,2*b,c]):\n print(N//2*int(M[3]*2)+M[1])\n elif M[2]==min([4*a,2*b,c]):\n print(N//2*int(M[3]*2)+M[2])\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s393364789', 's755306536', 's677458608']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 18.0]
[484, 445, 485]
p03617
u762420987
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\nA = min(Q*4, H*2, S)\nif N % 2 == 0:\n print(min(A*N, D*N//2))\nelse:\n print(min(A*N, D*(N+1)//2, D*N//2+A))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\nA = min(Q*4, H*2, S)\nif N % 2 == 0:\n print(min(A*N, D*N//2))\nelse:\n if N == 1:\n print(A)\n else:\n print(min(A*N, D*(N//2)+A))\n']
['Wrong Answer', 'Accepted']
['s811038778', 's122054031']
[3060.0, 2940.0]
[17.0, 17.0]
[168, 205]
p03617
u767664985
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['Q, H, S, D = map(int, input().split())\nN = int(input())\n\nans = 0\nfor w in range(N//2+1):\n for z in range(N-2*w+1):\n for y in range(2*(N-2*w-z)+1):\n x = 4 * (N - 2*w - z - y//2)\n ans = min(ans, Q*x + H*y + S*z + D*w)\n\nprint(ans)\n', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\ntwo_l = min(8*Q, 4*H, 2*S, D)\none_l = min(4*Q, 2*H, S)\n\nans = (N//2)*two_l + (N%2)*one_l\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s156637261', 's969141461']
[3060.0, 2940.0]
[2104.0, 18.0]
[260, 157]
p03617
u777283665
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\n\nQ = q / 0.25\nH = h / 0.5\nS = s\nD = d / 2.0\n\nif n == 1:\n print(min(Q, H, S))\nelse:\n if min(Q, H, S) <= D:\n print(n * min(Q, H, S))\n else:\n x, y = divmod(n, 2)\n print(x * 2 * D + y * min(Q, H, S))', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\nQ = q * 4\nH = h * 2\nS = s\nD = d / 2\n\nif n == 1:\n print(int(min(Q, H, S)))\nelse:\n if min(Q, H, S) <= D:\n print(int(n * min(Q, H, S)))\n else:\n print((n // 2) * d + (n % 2) * min(Q, H, S))']
['Wrong Answer', 'Accepted']
['s822850834', 's461937014']
[3064.0, 3064.0]
[17.0, 17.0]
[281, 265]
p03617
u777923818
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['volume = [1,2,4, 8]\nvalue = tuple(map(int, input().split())\nN = int(input())\n\ncounts = [10**10 for _ in range(N*4 + 1)]\ncounts[0] = 0\n\nfor i in range(4):\n for n in range(volume[i], N*4+1):\n counts[n] = min(counts[n], counts[n-volume[i]] + value[i])\n\nprint(counts[-1])', '# -*- coding: utf-8 -*-\ndef inpl(): return tuple(map(int, input().split()))\n\nvolume = [1, 2, 4, 8]\nvalue = {k:v for k, v in zip(volume, inpl())}\ncosp = {k:v/k for k, v in value.items()}\nN = int(input())\nN = N*4\nres = 0\n\nfor k, _ in sorted(cosp.items(), key=lambda x: x[1]):\n res += (N // k)*value[k]\n N = N % k\nprint(int(res))']
['Runtime Error', 'Accepted']
['s084023503', 's029237613']
[2940.0, 3064.0]
[18.0, 17.0]
[277, 332]
p03617
u798818115
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['# coding: utf-8\n# Your code here!\ncost=list(map(int,input().split()))\n\nfor i in range(4):\n cost[i]/=2**(i-2)\n\nN=int(input())\n\nif min(cost)==cost[3]:\n print(((N//2*2)*cost[3]+(N%2)*min(cost[:3])))\nelse:\n print((min(cost)*N))', '# coding: utf-8\n# Your code here!\nQ,H,S,D=map(int,input().split())\nN=int(input())\ntemp=min(4*Q,2*H,S,D/2)\n\nif temp!=D/2:\n print(N*temp)\nelse:\n if N%2==1:\n print(((N-1)*temp+min(4*Q,2*H,S)))\n else:\n print((N*temp))\n\n \n\n', '# coding: utf-8\n# Your code here!\nQ,H,S,D=map(int,input().split())\nN=int(input())\n\nn=N//2*2\nans=min(Q*4*n,H*2*n,S*n,D*n//2)\n\nif N%2==1:\n ans+=min(Q*4,H*2,S)\n \nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s394821130', 's604416814', 's983957958']
[3060.0, 3060.0, 3188.0]
[17.0, 18.0, 18.0]
[232, 244, 176]
p03617
u811176339
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['price = [int(w) for w in input().split()]\nn = int(input())\nprice[0]*4\nprice[1]*2\ncheap = min(price[:3])\n\nans = n // 2 * min(cheap * 2, price[3])\nans += n % 2 * cheap\n\n\nprint(ans)\n', 'price = [int(w) for w in input().split()]\nn = int(input())\nprice[0]*=4\nprice[1]*=2\ncheap = min(price[:3])\n\nans = n // 2 * min(cheap * 2, price[3])\nans += n % 2 * cheap\n\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s062871984', 's932409684']
[9168.0, 9164.0]
[26.0, 30.0]
[179, 181]
p03617
u814986259
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['price=list[map(int,input().split())]\nk=[0.25,0.5,1.0,2.0]\n\nN=int(input())\n\nfrom itertools import permutations\nans=float("Inf")\nfor x in permutations([0,1,2,3]):\n tmp=0\n n=N\n for y in x:\n tmp+= (n//k[y])*price[y]\n n=n%k[y]\n ans=min(tmp,ans)\n \nprint(ans)\n \n ', 'from itertools import permutations\nQ, H, S, D = map(int, input().split())\nN = int(input())*4\n\nans = 0\ns = [(Q, 1), (H, 2), (S, 4), (D, 8)]\n\nans = float("inf")\nfor x in permutations(s):\n tmp = 0\n n = N\n for a, b in x:\n tmp += (n // b)*a\n n %= b\n ans = min(ans, tmp)\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s999528922', 's359773100']
[3064.0, 3064.0]
[17.0, 17.0]
[269, 302]
p03617
u820351940
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q, h, s, d = map(int, input().split())\nn = int(input())\n\ns = min(4 * h, 8 * q, s)\nif s * 2 < d:\n print(s * n)\nelse:\n print((n//2) * d + (s if n % 2 else 0))\n', 'q, h, s, d = map(int, input().split())\nn = int(input())\n\ns = min(2 * h, 4 * q, s)\nif s * 2 < d:\n print(s * n)\nelse:\n print((n//2) * d + (s if n % 2 else 0))\n']
['Wrong Answer', 'Accepted']
['s983908293', 's875370696']
[3068.0, 2940.0]
[17.0, 17.0]
[163, 163]
p03617
u859125915
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nn=int(input())\n \nl=min(q*n*8,h*n*4,s*n*2,d*n)\nif l != d*n:\n print(l/2)\nelse:\n m=min(q*4,h*2,s)\n print((d*(n-1)/2)+m if n%2==1 else l/2)', 'q,h,s,d=map(int,input().split())\nn=int(input())\n \nl=min(q*n*8,h*n*4,s*n*2,d*n)\nif l != d*n:\n print (int(l//2))\nelse:\n m=min(q*4,h*2,s)\n print(int(d*(n-1)//2)+m if n%2==1 else int(l//2))\n']
['Wrong Answer', 'Accepted']
['s129630402', 's539820623']
[3060.0, 3060.0]
[17.0, 17.0]
[177, 195]
p03617
u861141787
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['N = int(input())\n\nPS = [[Q * 4, 0.25], [H * 2, 0.5], [S, 1], [D / 2, 2]]\n\nPS.sort(key=lambda x: x[0])\n\n# print(PS)\n\nR = N\nans = 0\nfor i in range (4):\n if R == 0:\n break\n elif R >= PS[i][1]:\n ans += PS[i][0] * PS[i][1] * (R // PS[i][1])\n R = R % PS[i][1]\n # print("ans :", ans)\n\nprint(int(ans))', 'Q, H, S, D = map(int, input().split())\nN = int(input())\n\nans = (N//2) * min(8 * Q, 4 * H, S * 2, D) + (N % 2) * min(4 * Q, 2 * H, S)\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s440003719', 's907937154']
[3064.0, 3064.0]
[17.0, 17.0]
[323, 144]
p03617
u884692162
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['import sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nQ, H, S, D = lr()\nN = ir()\n\nN = N * 4\ncost = [2 << 31 for _ in range(N+1)]\ncost[0] = 0\nfor n in range(N+1):\n if n >= 1:\n cost[n] = cost[n-1] + Q\n if n >= 2:\n cost[n] = min(cost[n], cost[n-1] + H)\n if n >= 4:\n cost[n] = min(cost[n], cost[n-4] + S)\n if n >= 8:\n cost[n] = min(cost[n], cost[n-8] + D)\n\nprint(cost[N])\n', 'import sys\nfrom collections import deque\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nQ, H, S, D = lr()\nN = ir()\n\nH = min(Q * 2, H)\nS = min(H * 2, S)\nif S * 2 <= D:\n print(S * N)\nelse:\n print((N // 2) * D + (N % 2) * S)\n']
['Wrong Answer', 'Accepted']
['s682635130', 's377098789']
[531224.0, 3436.0]
[2126.0, 27.0]
[475, 291]
p03617
u919633157
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['# 2019/08/08\n\nQ,H,S,D=map(int,input().split())\nn=int(input())\n\nq=Q*4\nh=H*2\ns=S\nd=D/2\nls=sorted([q,h,s,d])\nif ls[0]==d and ls[1]!=d:\n if n%2:\n ans=D*(n//2)\n else:\n ans=D*(n//2)+ls[1]\n\nelse:\n ans=int(ls[0]*n)\nprint(ans)', '\n# 2019/08/08\n\nQ,H,S,D=map(int,input().split())\nn=int(input())\n\nans=(n//2)*min(8*Q,4*H,2*S,D)+(n%2)*(min(4*Q,2*H,S))\nprint(ans)']
['Wrong Answer', 'Accepted']
['s555356262', 's326282136']
[3064.0, 3060.0]
[17.0, 17.0]
[240, 144]
p03617
u941753895
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['q,h,s,d=map(int,input().split())\nn=int(input())\nl=[[0.25,q,q*4]]\nl.append([0.5,h,h*2])\nl.append([1,s,s])\nl.append([2,d,d/2])\nl=sorted(l,key=lambda x:x[2])\nprint(l)\nc=0\ni=0\nwhile True:\n if i>=4 or int(n)<=0:\n break\n a=n//l[i][0]\n if a==0:\n i+=1\n continue\n c+=a*l[i][1]\n n-=a*l[i][0]\nprint(int(c))', 'import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\ndd=[(-1,0),(0,1),(1,0),(0,-1)]\nddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef I(): return int(sys.stdin.readline())\ndef LS(): return sys.stdin.readline().split()\ndef S(): return input()\n\ndef main():\n q,h,s,d=LI()\n n=I()\n\n q*=4\n h*=4\n s*=4\n d*=4\n n*=4\n\n l=[]\n l.append([q,1,q/1])\n l.append([h,2,h/2])\n l.append([s,4,s/4])\n l.append([d,8,d/8])\n\n l=sorted(l,key=lambda x:x[2])\n\n ans=0\n for x in l:\n if n%x[1]==0:\n ans+=(n//x[1])*x[0]\n return ans//4\n else:\n ans+=(n//x[1])*x[0]\n n%=x[1]\n\n# main()\nprint(main())\n']
['Wrong Answer', 'Accepted']
['s620313112', 's379172291']
[3064.0, 6480.0]
[17.0, 58.0]
[309, 850]
p03617
u961683878
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['#! /usr/bin/env python3\n\nimport sys\nimport numpy as np\nint1 = lambda x: int(x) - 1\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(500000)\n\nQ, H, S, D, N = map(int, read().split())\nH = min(Q * 2, H)\nS = min(H *2 , S)\n\nprint(H, S, D)\n\nif S * 2 < D:\n print(N * S)\nelse:\n print(N // 2 * D + N % 2 * S)', '#! /usr/bin/env python3\n\nimport sys\nimport numpy as np\nint1 = lambda x: int(x) - 1\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(500000)\n\nQ, H, S, D, N = map(int, read().split())\nH = min(Q * 2, H)\nS = min(H *2 , S)\n\nif S * 2 < D:\n print(N * S)\nelse:\n print(N / 2 * D + N % 2 * S)', '#! /usr/bin/env python3\n\nimport sys\nimport numpy as np\nint1 = lambda x: int(x) - 1\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(500000)\n\nQ, H, S, D, N = map(int, read().split())\nH = min(Q * 2, H)\nS = min(H *2 , S)\n\nif S * 2 < D:\n print(N * S)\nelse:\n print(N // 2 * D + N % 2 * S)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s578031621', 's643745684', 's770497936']
[12504.0, 12496.0, 12496.0]
[149.0, 149.0, 148.0]
[383, 366, 367]
p03617
u970809473
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['a,b,c,d=map(int,input().split())\nn=int(input())\nif n == 1:\n print(min(a*4,b*2,c))\nelif n%2 == 0:\n print(min(a*4*n,b*2*n,c*n,d*n//2))\nelse:\n print(min(a*4*n,b*2*n,c*n,d*n//2+min(a*4,b*2,c)))', 'a,b,c,d=map(int,input().split())\nn=int(input())\nif n == 1:\n print(min(a*4,b*2,c))\nelif n%2 == 0:\n print(min(a*4*n,b*2*n,c*n,d*n//2))\nelse:\n print(min(a*4*n,b*2*n,c*n,n//2*d+min(a*4,b*2,c)))\n']
['Wrong Answer', 'Accepted']
['s844688684', 's719869503']
[3064.0, 3060.0]
[17.0, 18.0]
[192, 193]
p03617
u977642052
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['def main(q: int, h: int, s: int, d: int, n: int):\n print((n // 2) * min(q * 8, h * 4, s * 2, d) + (n % 2) * min(q * 4, h * 2, s))\n\n\nif __name__ == "__main__":\n q, h, s, d = map(int, input().split())\n n = int(input)\n\n main(q, h, s, d, n)\n', 'def main(q: int, h: int, s: int, d: int, n: int):\n print((n // 2) * min(q * 8, h * 4, s * 2, d) + (n % 2) * min(q * 4, h * 2, s))\n\n\nif __name__ == "__main__":\n q, h, s, d = map(int, input().split())\n n = int(input())\n\n main(q, h, s, d, n)\n']
['Runtime Error', 'Accepted']
['s356966481', 's165562733']
[3060.0, 3060.0]
[17.0, 17.0]
[249, 251]
p03617
u980205854
2,000
262,144
You've come to your favorite store Infinitesco to buy some ice tea. The store sells ice tea in bottles of different volumes at different costs. Specifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen. The store has an infinite supply of bottles of each type. You want to buy exactly N liters of ice tea. How many yen do you have to spend?
['# A - Ice Tea Store\n\nQ, T, S, D = map(int, input().split())\nN = int(input())\n\nfor_1L = min(4*Q, 2*T, S)\nfor_2L = min(for_1L, D)\n\nprint((N//2)*for_2L + (N%2)*for_1L)', '# A - Ice Tea Store\n\nQ, T, S, D = map(int, input().split())\nN = int(input())\n\nfor_1L = min(4*Q, 2*T, S)\nfor_2L = min(2*for_1L, D)\n\nprint((N//2)*for_2L + (N%2)*for_1L)']
['Wrong Answer', 'Accepted']
['s026315587', 's171148410']
[2940.0, 2940.0]
[18.0, 17.0]
[164, 166]
p03627
u057993957
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['import collections\n\nn = int(input())\np = list(map(int,input().split()))\ncnt = collections.Counter(p)\n\nmaxs = []\nfor k, v in cnt.items():\n if v > 1:\n maxs.append(k)\n \nif len(maxs) > 1:\n maxs.sort()\n if len(maxs[-1]) > 3:\n print(maxs[-1] ** 2)\n else:\n print(maxs[-1] * maxs[-2])\n\nelse:\n print(0)', 'import collections\n\nn = int(input())\np = list(map(int,input().split()))\ncnt = collections.Counter(p)\n\nmaxs = []\nfor k, v in cnt.items():\n if v > 1:\n maxs.append(k)\n \nif len(maxs) > 1:\n maxs.sort()\n if cnt[maxs[-1]] > 3:\n print(maxs[-1] ** 2)\n else:\n print(maxs[-1] * maxs[-2])\n\nelse:\n print(0)']
['Runtime Error', 'Accepted']
['s414143031', 's476205406']
[18600.0, 18600.0]
[78.0, 75.0]
[310, 310]
p03627
u075303794
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['import collections\nn = int(input())\nl = map(int, input().split())\nc = collections.Counter(l)\nc = sorted(c.items(), key=lambda c:c[0], reverse=True)\n\nans = 1\ncnt = 0\n\nfor key,val in c:\n if cnt=0 and val>=4:\n ans=key**2\n break\n if val>=2:\n ans*=key\n cnt+=1\n if cnt == 2:\n break\nelse:\n ans = 0\nprint(ans)', 'import collections\nn = int(input())\nl = map(int, input().split())\nc = collections.Counter(l)\nc = sorted(c.items(), key=lambda c:c[0], reverse=True)\n \nans = 1\ncnt = 0\n \nfor key,val in c:\n if cnt==0 and val>=4:\n ans=key**2\n break\n if val>=2:\n ans*=key\n cnt+=1\n if cnt == 2:\n break\nelse:\n ans = 0\nprint(ans)']
['Runtime Error', 'Accepted']
['s928547583', 's645646990']
[2940.0, 24104.0]
[18.0, 157.0]
[320, 323]
p03627
u089142196
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['from collections import Counter\n\nN = int(input())\nA=list(map(int,input().split()))\nc=dict(Counter(A))\n#print(c)\ne=[]\nf=[]\n\nfor i in c:\n if c[i]>1:\n e.append(i)\n if c[i]>=4:\n f.append(i)\n\ne.sort(reverse=True)\nf.sort(reverse=True)\nif f[0]>=e[0]:\n print(f[0]**2)\nelse:\n if len(e)>=2:\n print(e[0]*e[1])\n else:\n print(0)', 'from collections import Counter\n\nN = int(input())\nA=list(map(int,input().split()))\nc=dict(Counter(A))\n#print(c)\ne=[]\nf=[]\n\nfor i in c:\n if c[i]>1:\n e.append(i)\n if c[i]>=4:\n f.append(i)\n\ne.sort(reverse=True)\nf.sort(reverse=True)\nif len(f)>=1:\n if f[0]>=e[0]:\n print(f[0]**2)\n else:\n if len(e)>=2:\n print(e[0]*e[1])\n else:\n print(0)\nelse:\n if len(e)>=2:\n print(e[0]*e[1])\n else:\n print(0) ']
['Runtime Error', 'Accepted']
['s884636801', 's010970317']
[21668.0, 21668.0]
[83.0, 83.0]
[332, 426]
p03627
u118642796
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['N = int(input())\nA = [int(a) for a in input().split()]\n\ndic = {}\nfor a in A:\n dic[a] = dic.get(a,0) + 1\n\np = []\nans = 0\n\nfor k in dic:\n if dic[k] >= 4:\n ans = max(ans,dic[k]**2)\n elif dic[k] >= 2:\n p.append(dic[k])\nif len(p)>=2:\n p.sort(reverse=True)\n ans = max(ans,p[0]*p[1])\nprint(ans)', 'N = int(input())\nA = [int(a) for a in input().split()]\n\ndic = {}\nfor a in A:\n dic[a] = dic.get(a,0) + 1\n\nB=[]\nfor k in dic:\n if dic[k]>=2:\n B.append(k)\n\nB.sort()\nif B>=2:\n print(B[-1]*B[-2])\nelse:\n print(0)', 'N = int(input())\nA = [int(a) for a in input().split()]\n\nA.sort()\n\nprint(A[-2]*A[-4])', 'N = int(input())\nA = [int(a) for a in input().split()]\n\ndic = {}\nfor a in A:\n dic[a] = dic.get(a,0) + 1\n\n2p = []\nans = 0\n\nfor k in dic:\n if dic[k] >= 4:\n ans = max(ans,dic[k]**2)\n elif dic[k] >= 2:\n 2p.append(dic[k])\nif len(2p)>=2:\n 2p.sort(reverse=True)\n ans = max(ans,2p[0]*2p[1])\nprint(ans)\n', 'N=int(input())\nA = [int(a) for a in input().split()]\n\nd = {}\nfor a in A:\n d[a] = d.get(a,0) + 1\nB = [0,0]\nfor k in d:\n if d[k] >= 4:\n B.append(k)\n B.append(k)\n elif d[k] >=2:\n B.append(k)\nB.sort()\nprint(B[-1]*B[-2])']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s146420469', 's660391814', 's728295496', 's786241559', 's455959562']
[18060.0, 17960.0, 14252.0, 2940.0, 17960.0]
[91.0, 95.0, 82.0, 17.0, 100.0]
[298, 213, 84, 305, 227]
p03627
u135389999
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['n = int(input())\nlens = list(map(int,input().split()))\n\nlens.sort(reverse = True)\ncnt = 0\nfor i in lens:\n if l.count(i) >= 4 and cnt != 0:\n print(i*2)\n break\n elif l.count(i) >= 2 and cnt == 0:\n cnt = i\n elif l.count(i) >= 2 and cnt != 0:\n print(cnt * i)\n break\nelse:\n print(0)', 'n = int(input())\nlens = list(map(int,input().split()))\nitems = set[lens]\nitems = list(items).sort(reverse = True)\ncnt = 0\nfor j in items:\n if j >= 4 and cnt == 0:\n print(j**2)\n break\n elif j >= 2 and cnt == 0:\n cnt = j\n elif j >= 2 and cnt != 0:\n print(cnt * j)\n break\nelse:\n print(0)', 'import collections\n \nn = int(input())\nlens = list(map(int,input().split()))\nlens = collections.Counter(lens)\nlens = sorted(lens.items(), key=lambda x:x[0], reverse = True)\ncnt = 0\nfor j in lens:\n if j[1] >= 4 and cnt == 0:\n print(j[0]**2)\n break\n elif j[1] >= 2 and cnt == 0:\n cnt = j[0]\n elif j[1] >= 2 and cnt != 0:\n print(cnt * j[0])\n break\nelse:\n print(0)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s126943204', 's891213771', 's082014187']
[15020.0, 14252.0, 21540.0]
[79.0, 44.0, 151.0]
[296, 303, 380]
p03627
u174404613
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['_=input()\nbars=[i for i in map(int,input().split())]\nbars.sort(reverse=True)\nstock=[]\nret=0\nfor bar in bars:\n count=bars.count(bar)\n if count>=4:\n ret=bar*bar\n break\n elif count>=2:\n stock.append(bar)\n if len(stock)==2:\n ret=stock[0]*stock[1]\n break\nprint(ret)', '#coding utf-8\n_=input()\nbars=[i for i in map(int,input().split())]\nbars.sort(reverse=True)\nstock=[]\nret=0\nfor bar in bars:\n count=bars.count(bar)\n if count>=4:\n if len(stock)!=0:\n ret=bar*stock[0]\n else:\n ret=bar*bar\n break\n elif count>=2:\n stock.append(bar)\n if len(stock)==2:\n ret=stock[0]*stock[1]\n break\nprint(ret)', '#coding utf-8\nimport numpy as np\n_=input()\nbars=[i for i in map(int,input().split())]\nnp_data=np.array(bars)\nbars.sort(reverse=True)\n\nstock=[]\nlen_stock=0\nret=0\n_old=-1\nfor bar in bars:\n if bar==_old:\n continue\n _old=bar\n count=len(np.where(bar))\n if count>=4:\n if len_stock!=0 and bar not in stock:\n \n ret=bar*stock[0]\n else:\n \n ret=bar*bar\n break\n elif count>=2:\n if bar in stock:\n continue\n stock.append(bar)\n len_stock+=1\n if len_stock==2 :\n \n ret=stock[0]*stock[1]\n break\nprint(ret)', '#coding utf-8\n_=input()\nbars=[i for i in map(int,input().split())]\nbars.sort(reverse=True)\nstock=[]\nret=0\n_old=-1\nfor bar in bars:\n if bar=_old:\n continue\n _old=bar\n count=bars.count(bar)\n if count>=4:\n if len(stock)!=0 and bar not in stock:\n \n ret=bar*stock[0]\n else:\n \n ret=bar*bar\n break\n elif count>=2:\n if bar in stock:\n continue\n stock.append(bar)\n if len(stock)==2 :\n \n ret=stock[0]*stock[1]\n break\nprint(ret)', '#coding utf-8\n_=input()\nbars=[i for i in map(int,input().split())]\nbars.sort(reverse=True)\nstock=[]\nret=0\nfor bar in bars:\n count=bars.count(bar)\n if count>=4:\n if len(stock)!=0 and bar not in stock:\n ret=bar*stock[0]\n else:\n ret=bar*bar\n break\n elif count>=2:\n stock.append(bar)\n if len(stock)==2:\n ret=stock[0]*stock[1]\n break\nprint(ret)', '#coding utf-8\nimport collections\n_=input()\nbars=[i for i in map(int,input().split())]\ndata=sorted(collections.Counter(bars).items(),key= lambda x: -x[0] )\nstock=0\nret=0\nfor bar ,count in data:\n if count>=4:\n if stock:\n ret=stock*bar\n break\n else:\n ret=bar*bar\n break\n elif count>=2:\n if stock:\n ret=stock*bar\n break\n else:\n stock=bar\nprint(ret)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s317966455', 's320025749', 's427972445', 's606567510', 's718628784', 's448180178']
[14252.0, 14672.0, 23228.0, 2940.0, 14224.0, 25500.0]
[2104.0, 2104.0, 295.0, 16.0, 2104.0, 158.0]
[319, 406, 714, 636, 427, 456]
p03627
u185424824
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['N = int(input())\nma1 = 0\nma2 = 0\nA = list(map(int,input().split()))\na = sorted(A,reverse = True)\n\nhold = 0\ncount = 0\n\nfor i in a:\n if i == hold:\n count += 1\n else:\n if count > 3 and ma1 == 0:\n ma1 = hold\n ma2 = hold\n elif count > 1:\n if ma1 == 0:\n ma1 = hold\n elif ma2 == 0:\n ma2 = hold\n hold = i\n count = 1\n if ma1 != 0 and ma2 != 0:\n break\n \n\nprint(ma1*ma2)\n ', 'N = int(input())\nma1 = 0\nma2 = 0\nA = list(map(int,input().split()))\nA.append(0)\na = sorted(A,reverse = True)\n\nhold = 0\ncount = 0\n\nfor i in a:\n if i == hold:\n count += 1\n else:\n if count > 3 and ma1 == 0:\n ma1 = hold\n ma2 = hold\n elif count > 1:\n if ma1 == 0:\n ma1 = hold\n elif ma2 == 0:\n ma2 = hold\n hold = i\n count = 1\n if ma1 != 0 and ma2 != 0:\n break\n \n\nprint(ma1*ma2)\n \n']
['Wrong Answer', 'Accepted']
['s552620321', 's642896231']
[14244.0, 14672.0]
[99.0, 98.0]
[426, 439]
p03627
u185896732
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['#import pysnooper\n\nfrom collections import Counter,deque\n#from operator import itemgetter\n#from itertools import accumulate,combinations,groupby,combinations_with_replacement\nfrom sys import stdin,setrecursionlimit\n#from copy import deepcopy\n\nsetrecursionlimit(10**6)\ninput=stdin.readline\n\nn=int(input().rstrip())\nh,w=0,0\na=sorted(Counter([int(i) for i in input().split()]).most_common(),reverse=1)+[(0,0)]\nprint(a)\nfor i in range(len(a)-1):\n if a[i][1]>=4:\n print(a[i][0]**2)\n exit()\n elif a[i][1]>=2:\n if h==0:\n h=a[i][0]\n else:\n print(h*a[i][0])\n exit()\nprint(0)', '#import pysnooper\n\nfrom collections import Counter,deque\n#from operator import itemgetter\n#from itertools import accumulate,combinations,groupby,combinations_with_replacement\nfrom sys import stdin,setrecursionlimit\n#from copy import deepcopy\n\nsetrecursionlimit(10**6)\ninput=stdin.readline\n\nh,w=0,0\nl=0\nn=int(input().rstrip())\na=sorted(Counter([int(i) for i in input().split()]).most_common(),reverse=1)\n#print(a)\nfor i in range(len(a)):\n if a[i][1]>=4:\n print(a[i][0]**2)\n exit()\n elif a[i][1]>=2:\n h=a[i][0]\n l=i+1\n break\n\nfor i in range(l,len(a)):\n if a[i][1]>=2:\n w=a[i][0]\n break\nprint(h*w)']
['Wrong Answer', 'Accepted']
['s120122857', 's645424272']
[21532.0, 21532.0]
[254.0, 200.0]
[676, 696]
p03627
u215630013
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['n = input()\nl = map(int, input().split())\n\nd = {}\nm = set()\nfor i in l:\n if i not in d:\n d[i] = 1\n else:\n d[i] += 1\n if d[i] > 2:\n m.add(i)\na = sorted(m, reverse=True)[:2]\nif len(a) == 0:\n print(0)\n exit()\nelif len(a) == 1 and d[a[0]] < 4:\n print(0)\n exit()\nif d[a[0]] > 3:\n print(i*i)\n exit()\nprint(a[0]*a[1])', 'n = input()\nl = list(map(int, input().split()))\nw, h, temp = 0, 0, 0\ncnt = 1\nfor i in sorted(l, reverse=True):\n if temp == i:\n cnt += 1\n if w == 0:\n w = i\n elif w != i:\n print(w*i)\n exit()\n if cnt == 4:\n print(w*w)\n exit() \n else:\n cnt = 1\n temp = i\nprint(0)']
['Wrong Answer', 'Accepted']
['s576568358', 's433452484']
[23692.0, 14764.0]
[88.0, 87.0]
[366, 360]
p03627
u223133214
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['import sys\nsys.setrecursionlimit(10**10)\nN = int(input())\nA = list(map(int, input().split()))\nA = sorted(A, reverse=True)\n\n\ndef chouhoukei(count, ans, num):\n if count == 4:\n return ans\n else:\n if num >= N:\n return 0\n if A[num] == A[num + 1]:\n return chouhoukei(count + 2, ans * A[num], num + 2)\n else:\n return chouhoukei(count, ans, num + 2)\n\n\nprint(chouhoukei(0, 1, 0))\n', 'import sys\nsys.setrecursionlimit(10**9)\nN = int(input())\nA = list(map(int, input().split()))\nA = sorted(A, reverse=True)\n\n\ndef chouhoukei(count, ans, num):\n if count == 4:\n return ans\n else:\n if num >= N - 1:\n return 0\n if A[num] == A[num + 1]:\n return chouhoukei(count + 2, ans * A[num], num + 2)\n else:\n return chouhoukei(count, ans, num + 1)\n\n\nprint(chouhoukei(0, 1, 0))\n']
['Runtime Error', 'Accepted']
['s983708287', 's817276829']
[3060.0, 79928.0]
[17.0, 160.0]
[438, 441]
p03627
u225388820
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['\nimport sys\ninput = sys.stdin.readline\nn=int(input())\na=list(map(int,input().split()))\na.sort(reverse=True)\nx=0\ny=a[0]\ni=1\nans=1\nwhile x<2 and i<n-1:\n if y==a[i]:\n ans*=y\n y=a[i+1]\n i+=2\n x+=1\n else:\n y=a[i]\n i+=1\nif x<2:\n print(0)\nelse:\n print(ans)', '\nimport sys\ninput = sys.stdin.readline\nn=int(input())\na=list(map(int,input().split()))\na.sort(reverse=True)\nans=1\ncnt=0\ni=0\nwhile i<n-1 and cnt<2:\n if a[i]==a[i+1]:\n ans*=a[i]\n i+=2\n cnt+=1\n else:\n i+=1\nif cnt==2:\n print(ans)\nelse:\n print(0)']
['Wrong Answer', 'Accepted']
['s574750182', 's009971507']
[14168.0, 14172.0]
[108.0, 103.0]
[466, 444]
p03627
u249447366
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['import collections\nimport sys\n\nN = int(input())\nA = list(map(int, input().split()))\nc = collections.Counter(A)\ntwo = [k for k, v in c.items() if v > 1]\nfour = [k for k, v in c.items() if v > 3]\nif len(two) < 2 and not four:\n print(0)\n sys.exit(0)\ntwo.sort(reverse=True)\nfour.sort(reverse=True)\ntmp = 1\nfor i in range(2):\n tmp *= two[i]\nmax_four = max(four)\nprint(tmp if tmp > max_four else max_four)\n', 'import collections\nimport sys\n\nN = int(input())\nA = list(map(int, input().split()))\nc = collections.Counter(A)\ntwo = [k for k, v in c.items() if v > 1]\nfour = [k for k, v in c.items() if v > 3]\nif len(two) < 2 and not four:\n print(0)\n sys.exit(0)\n\nSt = 0\nSf = 0\nif two:\n two.sort(reverse=True)\n St = 1\n for i in range(2):\n St *= two[i]\nif four:\n Sf = max(four) ** 2\nprint(St if St > Sf else Sf)\n']
['Runtime Error', 'Accepted']
['s133994662', 's759301894']
[18600.0, 18600.0]
[75.0, 85.0]
[409, 420]
p03627
u268516119
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['import collections\nimport copy\ndef main():\n ct=collections.Counter\n N=int(input())\n A=[int(i) for i in input().split()]\n B=ct(A)\n anum=sorted(B,reverse=True)\n tate=0\n yoko=0\n for _ in range(2):\n for k,a in enumerate(anum):\n if B[a]>=2 and tate==0:\n tate=a\n elif B[a]>2 and tate:\n if a==tate and B[a]<4:continue;\n else:\n yoko=a;break;\n print(tate*yoko)\n \nif __name__=="__main__":\n main()', 'import collections\nimport copy\ndef main():\n ct=collections.Counter\n N=int(input())\n A=[int(i) for i in input().split()]\n B=ct(A)\n anum=sorted(B,reverse=True)\n tate=0\n yoko=0\n for _ in range(2):\n for k,a in enumerate(anum):\n if B[a]>=2 and tate==0:\n tate=a\n break\n elif B[a]>=2 and tate:\n if a==tate and B[a]<4:continue;\n else:\n yoko=a\n break\n print(tate*yoko)\n \nif __name__=="__main__":\n main()']
['Wrong Answer', 'Accepted']
['s529016276', 's314778171']
[18320.0, 18320.0]
[180.0, 167.0]
[512, 554]
p03627
u268792407
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['n=int(input())\na=list(map(int,input().split()))\nimport collections\nc=collections.Counter(a)\nt=list(c.items())\nt.sort(reverse=True)\nif t[0][1]>=4:\n print(t[0][0]**2)\nelif t[1][1]>=2:\n print(t[0][0]*t[1][0])\nelse:\n print(0)', 'n=int(input())\na=list(map(int,input().split()))\nimport collections\nc=collections.Counter(a)\nt=list(c.items())\nt.sort(reverse=True)\ns=c.most_common()\nif s[0][1]<4 and s[1][1]<2:\n print(0)\n exit()\nwhile t[0][1]<2:\n del t[0]\nif t[0][1]>=4:\n print(t[0][0]**2)\nelse:\n while t[1][1]<2:\n del t[1]\n print(t[0][0]*t[1][0])']
['Wrong Answer', 'Accepted']
['s212847805', 's667201898']
[21384.0, 29192.0]
[177.0, 1651.0]
[224, 322]
p03627
u276204978
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\nA = Counter(A)\n\np = []\nl = []\nfor k, v in A.items():\n if v >= 4:\n p.append(k)\n if v >= 2:\n l.append(k)\nif len(l) >= 2:\n p.sort()\n l.sort()\n print(max(l[-1] * l[-2], p[-1]**2))\nelse:\n print(0)', 'from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\nA = Counter(A)\n\np = []\nl = []\nfor k, v in A.items():\n if v >= 4:\n p.append(k)\n if v >= 2:\n l.append(k)\n\nans = 0\nif len(p) >= 1:\n p.sort()\n ans = p[-1]**2\nif len(l) >= 2:\n l.sort()\n ans = max(l[-1] * l[-2], ans)\nprint(ans)']
['Runtime Error', 'Accepted']
['s100748587', 's491486739']
[18600.0, 18600.0]
[80.0, 77.0]
[309, 339]
p03627
u288430479
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['n = int(input())\nl = list(map(int,input().split()))\nl1 = [0,0]\nfrom collections import Counter\nc = Counter(l)\nfor i in c:\n while l[i]>=2 and len(l1)<4:\n l1.append(l[i])\nprint(l1[-1]*l1[-2])', 'n = int(input())\nl = list(map(int,input().split()))\nl1 = [0,0]\nfrom collections import Counter\nc = Counter(l)\nfor i in c.items():\n if i[1]>=2 :\n l1.append(i[0])\nsort.(l1)\nprint(l1[-1]*l1[-2])', 'n = int(input())\nl = list(map(int,input().split()))\nl1 = [0,0]\nfrom collections import Counter\nc = Counter(l)\nfor i in c.items():\n if i[1]>=2 :\n l1.append(i[0])\n if i[1]>=4 :\n l1.append(i[0])\nl1.sort()\nprint(l1[-1]*l1[-2])']
['Runtime Error', 'Runtime Error', 'Accepted']
['s041881642', 's919002199', 's232685700']
[18448.0, 2940.0, 18448.0]
[61.0, 17.0, 81.0]
[193, 195, 230]
p03627
u296150111
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['n=int(input())\na=list(map(int,input().split()))\na.sort()\na.reverse()\ncnt=0\nd=[]\ni=0\nwhile i<n-1:\n\tif a[i]==a[i+1]:\n\t\tcnt+=1\n\tif cnt==1:\n\t\td.append(a[i])\n\telif cnt==3:\n\t\td.append(a[i])\n\t\td.append(a[i-2])\n\tif a[i]!=a[i+1]:\n\t\tcnt=0\n\tif len(d)==2:\n\t\tprint(d[0]*d[1])\n\t\texit()\n\ti+=1\n\nprint(0)\n\n', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\na.reverse()\ncnt=0\nx=0\nd=[]\nfor i in range(n):\n\tif x==a[i]:\n\t\tcnt+=1\n\telse:\n\t\tx=a[i]\n\t\tcnt=0\n\tif cnt==1:\n\t\td.append(a[i])\n\tif cnt==3:\n\t\td.append(a[i])\n\tif len(d)==2:\n\t\tbreak\nif len(d)<=1:\n\tprint(0)\n\texit()\nprint(d[0]*d[1])']
['Wrong Answer', 'Accepted']
['s669531900', 's738719826']
[14252.0, 14244.0]
[129.0, 105.0]
[289, 278]
p03627
u306412379
2,000
262,144
We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.
['n = int(input())\naa = list(map(int, input().split()))\nbb = set()\ncc = set()\n\nfor a in aa:\n if aa.count(a) > 1:\n bb.add(a)\n if aa.count(a) >3:\n cc.add(a)\n \nm1 = max(bb)\nbb.remove(m1)\nm2 = max(bb)\n\nif len(cc) > 0:\n y = max(cc)\nelse:\n y = 0\n\nif len(bb) >= 2:\n ans = max(m1*m2, y*y)\nelse:\n ans = max(0, y*y)\nprint(ans)', 'import collections\nn = int(input())\naa = list(map(int, input().split()))\nca = collections.Counter(aa)\nla = sorted([a for a in ca.items()], key = lambda x:x[0], reverse=True)\n\nlist1 = []\nlist2 = []\n\nfor a in la:\n if a[1] > 1:\n list1.append(a)\n if a[1] >3:\n list2.append(a)\n \nif len(list1) > 1: \n xr = list1[0][0] * list1[1][0]\nelse:\n xr = 0\n \nif len(list2) > 0:\n xs = list2[0][0] * list2[0][0]\nelse:\n xs = 0\n \nans = max(xr, xs)\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s360609494', 's560360727']
[19984.0, 27988.0]
[2206.0, 111.0]
[329, 462]