#include using namespace std; set> s; int tab[1005][2]; int plansza[1005][1005]; bool xd1[1005]; bool xd2[1005]; int check(int a,int c,int d) { for(int x=0;x>a; for(int x=0;x>tab[x][0]>>tab[x][1]; plansza[tab[x][0]][tab[x][1]]=x+1; } for(int x=1;x