//细菌繁殖 #include<stdio.h> int main() { int month[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int n; scanf("%d",&n); int month_1,day_1,Num,month_2,day_2; for(int i=0;i<n;i++) { scanf("%d%d%d%d%d",&month_1,&day_1,&Num,&month_2,&day_2); int days=0; for(int j=month_1;j<month_2;j++) { days+=month[j]; } days-=day_1; days+=day_2; long sum=Num; for(int k=0;k<days;k++) { sum*=2; } printf("%d ",sum); } return 0; }