#include #include using namespace std; uint32_t x = 0, y = 1, z = 2, w = 3; void init(){ x = 0, y = 1, z = 2, w = 3; } uint32_t generate() { uint32_t t = (x^(x<<11)); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); return w; } typedef long long ll; int main(){ int64_t seed; cin >> seed; uint32_t l = 0, r = UINT_MAX; while(r-l > 1){ init(); x = seed; uint32_t mid = l + (r-l)/2, tmp; int cnt = 0; for(int i = 0; i < 10000001; i++){ tmp = generate(); if(tmp <= mid) cnt++; } if(cnt >= 5000001) r = mid; else l = mid+1; } cout << r << endl; return 0; }