细菌繁殖

//细菌繁殖

#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\n",sum);
	}
	return 0;
}

posted on 2015-06-24 11:22  _noname  阅读(148)  评论(0编辑  收藏  举报