QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#758725#9552. The Chariotucup-team059WA 12ms10648kbPython3661b2024-11-17 19:29:472024-11-17 19:29:48

Judging History

你现在查看的是最新测评结果

  • [2024-11-17 19:29:48]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:10648kb
  • [2024-11-17 19:29:47]
  • 提交

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'