Introduction

This is my blog of programming, I take notes and leave codes of computer science problems I solved here. Be my guest to comment :)

Thursday, November 1, 2012

uva 11498 - Division of Nlogonia

Problem link
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;

int main() {
 int k;
 cin >> k;
 while (k!=0) 
 {
  int n,m,x,y;
  cin >> n >> m;
  for (int i=1; i<=k; i++)
  {
   cin >> x >> y;
   int xI,yI;
   xI = x-n;
   yI = y-m;
   if (xI>0 && yI>0) cout << "NE" << endl;
   else if (xI>0 && yI<0) cout << "SE" << endl;
   else if (xI<0 && yI<0) cout << "SO" << endl;
   else if (xI<0 && yI>0) cout << "NO" << endl;
   else cout << "divisa" << endl;
  }
  cin >> k;
 }
 return 0;
}

No comments:

Post a Comment