1 #include<stdio.h> 2 int main() 3 { 4 int n,y,m,d; 5 scanf("%d",&n); 6 while(n--) 7 { 8 scanf("%d%d%d",&y,&m,&d); 9 switch(m) 10 { 11 case 2:d+=31;break; 12 case 3:d+=59;break; 13 case 4:d+=90;break; 14 case 5:d+=120;break; 15 case 6:d+=151;break; 16 case 7:d+=181;break; 17 case 8:d+=212;break; 18 case 9:d+=243;break; 19 case 10:d+=273;break; 20 case 11:d+=304;break; 21 case 12:d+=334;break; 22 } 23 if((m>2&&y%4==0&&y%100!=0)||y%400==0&&m>2) 24 d++; 25 printf("%d ",d); 26 } 27 }