Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int one, two, three, four;
- int max(int a, int b){
- return a>=b?a:b;
- }
- void checkQuadrant(int x, int y){
- if(x>0 && y>0){
- one++;
- }else if(x<0 && y>0){
- two++;
- }else if(x<0 && y<0){
- three++;
- }else if(x>0 && y<0){
- four++;
- }
- }
- int main(){
- int tc, x, y, n;
- scanf("%d", &tc);
- for(int i=1;i<=tc;i++){
- one=two=three=four=0;
- scanf("%d", &n);
- for(int j=0;j<n;j++){
- scanf("%d %d", &x, &y);
- checkQuadrant(x, y);
- }
- printf("Case #%d: %s\n", i, n-max(one,max(two,max(three,four)))>1?"NO":"YES");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement