fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int k, m, n, x, y;
  5. while (scanf("%i", &k)) {
  6. if (k == 0) {
  7. break;
  8. }
  9.  
  10. scanf("%i %i", &m, &n);
  11.  
  12. for(int i = 0; i < k; i ++) {
  13. scanf("%i %i", &x, &y);
  14.  
  15. if(x == m || y == n) {
  16. printf("divisa\n");
  17. } else if(x > m && y > n) {
  18. printf("NE\n");
  19. } else if(x < m && y < n) {
  20. printf("SO\n");
  21. } else if(x < m && y > n) {
  22. printf("NO\n");
  23. } else if(x > m && y < n) {
  24. printf("SE\n");
  25. }
  26. }
  27. }
  28. return 0;
  29. }
Success #stdin #stdout 0s 9432KB
stdin
3
2 1
10 10
-10 1
0 33
4
-1000 -1000
-1000 -1000
0 0
-2000 -10000
-999 -1001
0
stdout
NE
divisa
NO
divisa
NE
SO
SE