while (True): K = int(input()) ifnot K: break N, M = map(int, input().split()) for _ inrange(K): X, Y = map(int, input().split()) if X == N or Y == M: print("divisa") elif X > N and Y > M: print("NE") elif X > N and Y < M: print("SE") elif X < N and Y > M: print("NO") else: print("SO")
intmain(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int k, n, m, x, y; while (cin >> k && k) { cin >> n >> m; while (k--) { cin >> x >> y; if (x == n || y == m) cout << "divisa" << endl; elseif (x > n && y > m) cout << "NE" << endl; elseif (x > n && y < m) cout << "SE" << endl; elseif (x < n && y > m) cout << "NO" << endl; else cout << "SO" << endl; } } return0; }
寫在最後
Cover photo is remixed from @Tekeli_liw3, thanks for their work!