02 January 2015

UVA 11498 - Division of Nlogonia

#include<iostream>
#include<stdio.h>

using namespace std ;
int main()
{
    long int test ;
    while(scanf("%ld",&test)==1)
    {
        if(test==0)
            break ;
        long i ,j ;
        cin>>i>>j ; int cor1 , cor2 ;
        for(int k=1 ; k<=test ; k++)
        {
            cin>>cor1>>cor2 ;
            if((cor1>i)&&(cor2>j))
                cout<<"NE"<<endl ;
            else if((cor1<i)&&(cor2>j))
                cout<<"NO"<<endl ;
              else if((cor1<i)&&(cor2<j))
                cout<<"SO"<<endl ;
                else if((cor1>i)&&(cor2<j))
                    cout<<"SE"<<endl ;
                  else if((cor1==i)||(cor2==j))
                    cout<<"divisa"<<endl ;
        }
    }

    return 0 ;
}

No comments:

Post a Comment

UVA 10679 - I Love Strings!!