#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
rnd5() {
}
long long fact(int a) {
return (a == 0) ? 1
: a * fact(a - 1)
;
}
long long phi(int a) {
return (a == 0) ? 1
: rnd5() * fact(a) + phi(a - 1)
;
}
rnd10009() {
return (phi(15) % 10009) + 1;
}
void main() {
int l[12340];
#define L 2000000
int i;
for(i=0;i<L;i++)
l[rnd10009()]++;
long long ai, a = -99999999;
long long bi, b = 999999999;
long long c = 0;
for(i=1;i<=10009;i++) {
if (l[i] > a) {a = l[i]; ai = i;}
if (l[i] < b) {b = l[i]; bi = i;}
c += l[i];
}
printf("もっとも出現回数の多かった数 : %lld -> [%lld]回\n" "もっとも出現回数の少なかった数 : %lld -> [%lld]回\n"
"出現回数の理想値:[%lld]回\n",
ai,a,bi,b, L/10009);
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8bWF0aC5oPgogCnJuZDUoKSB7CiAgICAgICAgcmV0dXJuIChyYW5kKCklNSkgKyAxOwp9CiAKbG9uZyBsb25nIGZhY3QoaW50IGEpIHsKICAgICAgICByZXR1cm4gKGEgPT0gMCkgPyAxCiAgICAgICAgICAgICAgICAgICAgICAgIDogYSAqIGZhY3QoYSAtIDEpCiAgICAgICAgICAgICAgICAgICAgICAgIDsKfQogCmxvbmcgbG9uZyBwaGkoaW50IGEpIHsKICAgICAgICByZXR1cm4gKGEgPT0gMCkgPyAxCiAgICAgICAgICAgICAgICAgICAgICAgIDogcm5kNSgpICogZmFjdChhKSArIHBoaShhIC0gMSkKICAgICAgICAgICAgICAgICAgICAgICAgOwp9CiAKcm5kMTAwMDkoKSB7CiAgICAgICAgcmV0dXJuIChwaGkoMTUpICUgMTAwMDkpICsgMTsKfQogCnZvaWQgbWFpbigpIHsKICAgICAgICBpbnQgbFsxMjM0MF07CiAgICAgICAgbWVtc2V0KGwsMCwxMjM0MCk7CiAKCgogICAgICAgICNkZWZpbmUgTCAyMDAwMDAwCgogICAgICAgIGludCBpOwogICAgICAgIGZvcihpPTA7aTxMO2krKykKICAgICAgICAgICAgICAgIGxbcm5kMTAwMDkoKV0rKzsKCgoKICAgICAgICBsb25nIGxvbmcgYWksIGEgPSAtOTk5OTk5OTk7CiAgICAgICAgbG9uZyBsb25nIGJpLCBiID0gOTk5OTk5OTk5OwogICAgICAgIGxvbmcgbG9uZyBjID0gMDsKIAogICAgICAgIGZvcihpPTE7aTw9MTAwMDk7aSsrKSB7CiAgICAgICAgICAgICAgICBpZiAobFtpXSA+IGEpIHthID0gbFtpXTsgYWkgPSBpO30KICAgICAgICAgICAgICAgIGlmIChsW2ldIDwgYikge2IgPSBsW2ldOyBiaSA9IGk7fQogICAgICAgICAgICAgICAgYyArPSBsW2ldOwogICAgICAgIH0KIAogICAgICAgIHByaW50Zigi44KC44Gj44Go44KC5Ye654++5Zue5pWw44Gu5aSa44GL44Gj44Gf5pWwICAgOiAlbGxkIC0+IFslbGxkXeWbnlxuIgogICAgICAgICAgICAgICAi44KC44Gj44Go44KC5Ye654++5Zue5pWw44Gu5bCR44Gq44GL44Gj44Gf5pWwIDogJWxsZCAtPiBbJWxsZF3lm55cbiIKICAgICAgICAgICAgICAgIuWHuuePvuWbnuaVsOOBrueQhuaDs+WApDpbJWxsZF3lm55cbiIsCiAgICAgICAgICAgICAgIGFpLGEsYmksYiwgTC8xMDAwOSk7Cn0=