# BZOJ4152: [AMPPZ2014]The Captain

5
2 2
1 1
4 5
7 1
6 7

## Sample Output

2

#include<cstdio>
#include<cctype>
#include<queue>
#include<cmath>
#include<cstring>
#include<algorithm>
#define rep(i,s,t) for(int i=s;i<=t;i++)
#define dwn(i,s,t) for(int i=s;i>=t;i--)
#define ren for(int i=first[x];i;i=next[i])
using namespace std;
const int BufferSize=1<<16;
inline char Getchar() {
}
}
int x=0,f=1;char c=Getchar();
for(;!isdigit(c);c=Getchar()) if(c=='-') f=-1;
for(;isdigit(c);c=Getchar()) x=x*10+c-'0';
return x*f;
}
const int maxn=200010;
const int maxm=800010;
const int inf=1e9;
struct Dijkstra {
int n,m,d[maxn],done[maxn],first[maxn],next[maxm];
struct Edge {int from,to,dist;}edges[maxm];
struct HeapNode {
int u,d;
bool operator < (const HeapNode& ths) const {return d>ths.d;}
};
void init(int n) {
this->n=n;m=1;
}
void AddEdge(int u,int v,int w) {
edges[m]=(Edge){u,v,w};next[m]=first[u];first[u]=m++;
}
priority_queue<HeapNode> Q;
void solve(int s) {
rep(i,1,n) d[i]=inf;
d[s]=0;Q.push((HeapNode){s,0});
while(!Q.empty()) {
int x=Q.top().u;Q.pop();
if(done[x]) continue;done[x]=1;
ren {
Edge& e=edges[i];
if(d[e.to]>d[x]+e.dist) {
d[e.to]=d[x]+e.dist;
Q.push((HeapNode){e.to,d[e.to]});
}
}
}
}
}sol;
struct Point {
int x,y,id;
}A[maxn];
bool cmp1(Point a,Point b) {return a.x<b.x;}
bool cmp2(Point a,Point b) {return a.y<b.y;}
int main() {
sort(A+1,A+n+1,cmp1);
rep(i,1,n) {
}
sort(A+1,A+n+1,cmp2);
rep(i,1,n) {
}