QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#758725 | #9552. The Chariot | ucup-team059 | WA | 12ms | 10648kb | Python3 | 661b | 2024-11-17 19:29:47 | 2024-11-17 19:29:48 |
Judging History
answer
_=int(input())
for __ in range(_):
a,b,c,x,y,d=map(int,input().split())
mn=10**5000
#A
t=a
if(d>x):
t=d%x*b
tt=a
if(d%x==0):
tt=0
mn=min(mn,d//x*a+min(t,tt))
#B
t=a
if(d%(x+y)==0):
t=0
elif(d%(x+y)<=x):
t=a
t=max(0,t-min(x-d%(x+y),d//(x+y)*y)*b)
else:
t=a+b*y
#t=a+b*(d%(x+y)-x)
tt=t
if(d>(x+y)):
tt=c*(d%(x+y))
mn=min(mn,d//(x+y)*(b*y+a)+min(t,tt))
#C
t=mn
if(d>(x+y)):
t=a+b*y+(d-x-y)*c
elif(d>x):
t=a+b*(d-x)
else:
t=a
mn=min(mn,t)
print(mn)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 10648kb
input:
5 160 27 41 3 12 3 160 27 41 3 12 4 160 27 41 3 12 99 1 999 999 1 99 999 999 999 1 1 99 9999999999999999
output:
160 187 3273 999 10000000000099799
result:
wrong answer 3rd lines differ - expected: '3226', found: '3273'