#include #include using namespace std; unsigned int x = 0, y = 1, z = 2, w = 3; unsigned int generate() { unsigned int t = (x^(x<<11)); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); return w; } int main(int argc, char* argv[]) { long long seed; cin >> seed; x = seed; const int MAX=10000001; multimap myMap; for (int i = 0; i < MAX; i++) { myMap.insert(multimap::value_type(generate(),1)); } multimap::iterator mit; int N=MAX/2; for (mit=myMap.begin();mit!=myMap.end();mit++){ N--; if (N==0){ break; } } cout<<(*mit).first<