UVa 11498 - Division of Nlogonia

/*
    Accepted

    Just match the test cases :D :D

*/

#include<bits/stdc++.h>
using namespace std;

#define sf scanf
#define pf printf
#define psb push_back
#define fast ios_base::sync_with_stdio(false)

typedef map<string, int>mpsi;
typedef map<int, string>mpis;
typedef long long LL;

const int high = 2e5+10;

void Solution(int N , int M , int x , int y)
{
    if(x == N || y == M)
    {
        cout << "divisa\n";
    }

    else if(x > N && y > M)
    {
        cout << "NE\n";
    }

    else if(x > N && y < M)
    {
        cout << "SE\n";
    }

    else if(x < N && y > M)
    {
        cout << "NO\n";
    }

    else if(x < N && y < M)
    {
        cout << "SO\n";
    }
}

int main()
{
    fast;
    int K;
    while(cin >> K && K)
    {
        int N , M ;
        cin >> N >> M;

        while(K--)
        {
            int x , y;
            cin >> x >> y;

            Solution(N , M , x , y);
        }
    }

    return 0;
}

Comments

Popular posts from this blog

SPOJ-CMG - Collecting Mango

LightOJ 1009 - Back to Underworld

LeetCode Palindrome Number