/* ID: zhangzz4 LANG: C++ TASK: friday */ #include<stdio.h> #include<string.h> #include<stdlib.h> int mon[2][14]= { {31,31,28,31,30,31,30,31,31,30,31,30,31}, {31,31,29,31,30,31,30,31,31,30,31,30,31} }; int main() { freopen("friday.in","r",stdin); freopen("friday.out","w",stdout); int n; scanf("%d",&n); int wf[8]={0},pre; for(int y=1900;y<1900+n;y++) { for(int i=1;i<=12;i++) { if(y==1900&&i==1) { pre=6; wf[pre]++; continue; } else { pre=(mon[(y%400==0)||(y%100&&y%4==0)][i-1]+pre)%7; wf[pre]++; } } } printf("%d %d %d %d %d %d %d/n",wf[6],wf[0],wf[1],wf[2],wf[3],wf[4],wf[5]); }