#include using namespace std; using pii=pair; using tii=tuple; using qii=tuple; using ll=long long; using ld=long double; const ll INF=1ll<<60; #define rep(i,n) for (int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() template inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template inline bool chmax(T &a,T b){ if(a A,B; namespace Solver{ int score(vector &ans){ vector a=A,b=B; for(auto [u,v]:ans){ a[v]=a[u]=(a[u]+a[v])/2; b[v]=b[u]=(b[u]+b[v])/2; } return floorl(2000000.0-100000.0*log10l(max(abs(C-a[0]),abs(C-b[0]))+1)); } void solve(){ vector ans; int pre_score=score(ans); int cnt=0; int max_score=0; vector max_score_ans; while(true){ auto now=chrono::system_clock::now(); int ms=chrono::duration_cast(now-program_start).count(); if(950<=ms) break; vector new_ans=ans; int r=mt()%4; int x=rand_int(N),y=rand_int(N); int sz=new_ans.size(); if(x==y) continue; if(y> N; A.resize(N); B.resize(N); rep(i,N) cin >> A[i] >> B[i]; Solver::solve(); }