#pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include #include using namespace std; long long start_time; void start_clock(){ struct timeval tv; gettimeofday(&tv, NULL); start_time=(tv.tv_sec*1000000+tv.tv_usec); } long long current_clock(){ struct timeval tv; gettimeofday(&tv, NULL); long long current_time=(tv.tv_sec*1000000+tv.tv_usec); // cout << current_time-start_time << "(us)\n"; return current_time-start_time; } using pl=pair; long long target=500000000000000000; double score(pl a){ long long mg=max(abs(a.first-target),abs(a.second-target)); return 1.0-0.05*log10(mg+1); } pl f(pl a,pl b){ return {(a.first+b.first)/2,(a.second+b.second)/2}; } typedef struct{ vector card; vector hand; }Game; long long eval(Game &g){ long long g1=abs(g.card[0].first-target); long long g2=abs(g.card[0].second-target); long long g3=abs(g.card[0].first-g.card[0].second); return -max(g1,g2); } #define BSIZE 10000 using pdi=pair; int main(){ start_clock(); int n; cin >> n; Game inig; inig.card.resize(n); for(auto &nx : inig.card){ cin >> nx.first >> nx.second; } inig.hand.clear(); vector gs={inig}; long long rr=-8e18; Game res=inig; for(int tr=0;tr<50;tr++){ vector ng; priority_queue,greater> pq; for(auto &nx : gs){ for(int i=0;i