#include #include #include #include #include using namespace std; int N,X[16],Y[16]; int dp[1<<16]; int dx[8]={2,2,1,-1,-2,-2,-1,1}; int dy[8]={1,-1,-2,-2,-1,1,2,2}; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N; vector >ps; map,int>mp; for(int i=0;i>X[i]>>Y[i]; mp[make_pair(X[i],Y[i])]=i; for(int r=0;r<8;r++)ps.push_back(make_pair(X[i]+dx[r],Y[i]+dy[r])); } sort(ps.begin(),ps.end()); ps.erase(unique(ps.begin(),ps.end()),ps.end()); for(int i=1;i<1<second; } for(int k=(1<=0;k--)dp[k|ni]=min(dp[k|ni],dp[k]+1); } } int ans=dp[(1<