#include <stdio.h>
#include <stdlib.h>
#include <math.h>
//-------math.edu.pl-------------
int przestepny(int rok)
{
return ((rok%4==0 && rok%100!=0) || rok%400==0);
}
//-------------------------------
int resztazDzielenia(int a, int b)
{
int r = a%b;
return r;
}
//-------------------------------
int dzienTygodnia(int dzien, int miesiac, int rok)
{
miesiac -= 2;
if (miesiac <1) miesiac += 12;
int p = przestepny(rok);
int r = rok%100;
int w
= (int) (dzien
+ floor(2.6*miesiac
-0.2) + r
+ (r
>>2) + (rok
/400) - ((rok
/100)<<1) - (1+p
)*(miesiac
/11));
return resztazDzielenia(w, 7);
}
//-------------------------------
int main(void)
{
int dzien, miesiac, rok;
int i, j, cnt=0;
//freopen("zapis.txt", "w", stdout);
for (i=2001; i<2101; i++)
for (j=1; j<13; j++)
if (dzienTygodnia(13, j, i) == 5)
printf("%d. 13-%02d-%d\n", ++cnt
, j
, i
);
return 0;
}
//-------math.edu.pl-------------
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPG1hdGguaD4KLy8tLS0tLS0tbWF0aC5lZHUucGwtLS0tLS0tLS0tLS0tCgppbnQgcHJ6ZXN0ZXBueShpbnQgcm9rKSAKeyAKIHJldHVybiAoKHJvayU0PT0wICAmJiAgcm9rJTEwMCE9MCkgfHwgcm9rJTQwMD09MCk7IAp9Ci8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoKaW50IHJlc3p0YXpEemllbGVuaWEoaW50IGEsIGludCBiKQp7CiAgIGludCAgciA9IGElYjsKICAgaWYgKHI8MCkgciArPSBhYnMoYik7IAoKcmV0dXJuICByOwp9Ci8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoKaW50IGR6aWVuVHlnb2RuaWEoaW50IGR6aWVuLCBpbnQgbWllc2lhYywgaW50IHJvaykgCnsgCiAgbWllc2lhYyAtPSAyOwogIGlmIChtaWVzaWFjIDwxKSBtaW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