#include<iostream>
using namespace std;
int main()
{
int n,i,j;
cin>>n;
int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
for(i=1;i<=n;i++)
{
int startmonth,firstday,endmonth,endday;
long firstnum,endnum;
int sum=0;
cin>>startmonth>>firstday>>firstnum>>endmonth>>endday;
for(j=startmonth;j<endmonth;j++)
{
sum=days[j-1]+sum;
}
sum=sum-firstday;
sum=sum+endday;
endnum=firstnum;
for(j=0;j<sum;j++)
endnum=2*endnum;
cout<<endnum<<endl;
}
}
来源:CSDN
作者:猫鼠兽
链接:https://blog.csdn.net/weixin_45921943/article/details/104138529