#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;
}
