#include using namespace std; #define rep(i, a, n) for (int i=(a); i < (n); i++) #define per(i, a, n) for (int i=(n)-1; i >= (a); i--) #define ll long long #define x first #define y second const ll INF = 2e18; typedef pair pt; int n; ll m; ll go(vector &v){ ll res = INF; vector> xo, yo; rep(i,0,n) xo.push_back({v[i], i}), yo.push_back({{v[i].y, v[i].x}, i}); sort(xo.begin(), xo.end()); sort(yo.begin(), yo.end()); rep(i,0,n) swap(yo[i].x.x, yo[i].x.y); set active; multiset xs, ys; int yi = 0; //for(auto a : xo) cout << a.x.x << " " << a.x.y << endl; //cout<<"---------"<= yo[yi].x.y) { active.insert(xo[i].second); xs.insert(xo[i].x.x); ys.insert(xo[i].x.y); } if(i < n-1 && xo[i+1].x.x == xo[i].x.x){ continue; } //cout << i << ": "< (n / 2)){ while(yi>m>>n){ vector> v(n); rep(i,0,n)cin>>v[i].x>>v[i].y; //cout<