#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<>N; LL plus = 0; LL pp = (N-2014)%(400*7); LL ppp; //plus = (N/4 - N/100 + N/400 - day0) + N-2014; LL same=0; for(LL i = 2014; i < 2014+400*7; ++i){ if(plus%7==0){ ++same; } if(2014+pp == i){ ppp = same; } // ++plus; if((i+1)%4==0 && ((i+1)%400==0 || (i+1)%100 != 0) ){ ++plus; } } LL ans = (N-2014)/(400*7) * same + ppp; P(ans-1); return 0; }