intmain(){ cin >> n; int flag = 1; for (int i = 0, x; i < n; i++){ cin >> x; if (x == 1) flag = 0; } if (flag) puts("EASY"); elseputs("HARD"); return0; }
intmain(){ cin >> n >> d >> m; for (int i = 0; i < m; i++){ int x, y; cin >> x >> y; if (x + y <= 2 * n - d && x + y >= d && y - x >= -d && y - x <= d){ puts("YES"); } elseputs("NO"); } return0; }
intmain(){ cin >> n >> s; int sum = 0; for (int i = 0; i < n; i++) sum += s[i] - '0'; for (int i = 2; i <= n; i++){ if (sum % i) continue; int x = sum / i, flag = 1, tot = 0; for (int j = 0; j < n; j++){ tot += s[j] - '0'; if (tot == x){ tot = 0; } elseif (tot > x){ flag = 0; break; } } if (flag){ puts("YES"); return0; } } puts("NO"); return0; }
ll n, m, k; ll gcd(ll a, ll b){return b ? gcd(b, a % b) : a;}
intmain(){ cin >> n >> m >> k; if (2 * n * m % k) returnputs("NO"), 0; puts("YES"); puts("0 0"); if (k % 2 == 0){ k /= 2; ll g = gcd(n, k); printf("%I64d 0\n0 %I64d", n / g, m / (k / g)); } else { ll g = gcd(n, k), a = n / g, b = m / (k / g); if (g == 1) b *= 2; else a *= 2; printf("%I64d 0\n0 %I64d", a, b); } return0; }