#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 a=A,b=B; vector ans; while((int)ans.size()<50){ ll mn=INF; int idx=-1; for(int i=1;i> N; A.resize(N); B.resize(N); rep(i,N) cin >> A[i] >> B[i]; Solver::solve(); }