#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
const int range = (int)1e6;
const int rand_max = (1 << 15) - 1;
vector<int> ans (range);
for (int i = 0; i <= rand_max; i++)
for (int j = 0; j <= rand_max; j++)
ans[i * j % range]++;
cout << "range = " << range << endl;
cout << "rand_max = " << rand_max << endl;
cout << "min occurences = " << *min_element(ans.begin(), ans.end()) << endl;
cout << "max occurences = " << *max_element(ans.begin(), ans.end()) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgICBjb25zdCBpbnQgcmFuZ2UgPSAoaW50KTFlNjsKICAgIGNvbnN0IGludCByYW5kX21heCA9ICgxIDw8IDE1KSAtIDE7IAogICAgdmVjdG9yPGludD4gYW5zIChyYW5nZSk7CiAgICBmb3IgKGludCBpID0gMDsgaSA8PSByYW5kX21heDsgaSsrKSAKICAgIGZvciAoaW50IGogPSAwOyBqIDw9IHJhbmRfbWF4OyBqKyspCiAgICAgICAgYW5zW2kgKiBqICUgcmFuZ2VdKys7CgogICAgY291dCA8PCAicmFuZ2UgPSAiIDw8IHJhbmdlIDw8IGVuZGw7CiAgICBjb3V0IDw8ICJyYW5kX21heCA9ICIgPDwgcmFuZF9tYXggPDwgZW5kbDsKICAgIGNvdXQgPDwgIm1pbiBvY2N1cmVuY2VzID0gIiA8PCAqbWluX2VsZW1lbnQoYW5zLmJlZ2luKCksIGFucy5lbmQoKSkgPDwgZW5kbDsKICAgIGNvdXQgPDwgIm1heCBvY2N1cmVuY2VzID0gIiA8PCAqbWF4X2VsZW1lbnQoYW5zLmJlZ2luKCksIGFucy5lbmQoKSkgPDwgZW5kbDsKICAgIHJldHVybiAwOwp9Cg==