#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
int x,y,z,w,n,m,a,i,k,f,q;
scanf("%d",&a);
for(i=0;i<a;i++){
f=0;
q=0;
scanf("%d%d%d%d%d%d",&x,&y,&z,&w,&n,&m);
while(scanf("%d",&k)!=EOF){
if(m<=0){
q=1;
cout<<"bye~Rabbit"<<endl;
break;
}
if(f==1){
m-=n;
}
switch(k){
case 1:
m+=x;
continue;
case 2:
m+=y;
continue;
case 3:
m-=z;
continue;
case 4:
m-=w;
f=1;
continue;
}
cout<<endl;
}
if(q==0){
cout<<m<<endl;
}
}
return 0;
有神能告訴我出了甚麼問題嗎? WA