From 91326c5c4b8a94096b57068fcbfa9fbf84968035 Mon Sep 17 00:00:00 2001 From: Hiyabye Date: Tue, 30 Jan 2024 13:14:53 +0900 Subject: [PATCH] Add 02991.cpp --- 02xxx/02991.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 02xxx/02991.cpp diff --git a/02xxx/02991.cpp b/02xxx/02991.cpp new file mode 100644 index 00000000..8baff24f --- /dev/null +++ b/02xxx/02991.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; + +int check(int t, int a, int r) { + return t % (a + r) && t % (a + r) <= a; +} + +void solve(void) { + int a, b, c, d; cin >> a >> b >> c >> d; + int p, m, n; cin >> p >> m >> n; + + cout << check(p, a, b) + check(p, c, d) << "\n"; + cout << check(m, a, b) + check(m, c, d) << "\n"; + cout << check(n, a, b) + check(n, c, d) << "\n"; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file