Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n,T;
- struct pnt
- {
- int x,y;
- pnt(){}
- pnt(int a,int b)
- {
- x=a;
- y=b;
- }
- };
- vector < pnt > v;
- int main()
- {
- freopen("date.in","r",stdin);
- scanf("%d",&T);
- while (T--)
- {
- v.clear();
- scanf("%d",&n);
- int x,y;
- while (n--)
- {
- scanf("%d %d",&x,&y);
- v.push_back(pnt(x,y));
- }
- bool ok=true;
- for (int i=0;i<v.size() && ok;i++)
- {
- for (int j=i+1;j<v.size() && ok;j++)
- {
- if ((v[i].x>v[j].x && v[i].y<v[j].y) ||
- (v[i].x<v[j].x && v[i].y>v[j].x))
- {
- printf("Da\n");
- ok=false;
- }
- }
- }
- if (ok) printf("Nu\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement