a271.
彩色蘿蔔
--
兔子
| From: [1.165.159.31] |
發表日期
:
2021-06-26 21:25
from sys import stdin
#x,y,z,w,n,m
#1,2,3,4,0
#r,wi,y,g
#while
t = int(stdin.readline())
for _ in range(t):
bb = list(map(int,stdin.readline().strip().split()))
if len(bb) == 6:
x,y,z,w,n,m = bb[0],bb[1],bb[2],bb[3],bb[4],bb[5]
if m<=0:
print('bye~Rabbit')
continue
lobos = []
lobos = list(map(int,stdin.readline().strip().split()))
if not lobos:
print('{}g'.format(m))
continue
days = len(lobos)
op = {1:x ,2:y ,3: (-1*z) ,4:(-1*w), 0:0}
poi = 0
ans = 1
for x in range(days):
print(m)
print(ans)
print('----')
m += (poi * n)
if m <= 0:
ans = 0
break
if lobos[x] != 4:
m += op[lobos[x]]
else:
m += op[4]
poi -= 1
if m <= 0:
ans = 0
break
if ans == 1:
print('{}g'.format(m))
else:
print('bye~Rabbit')