Skip to content

Commit

Permalink
Add 02991.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jan 30, 2024
1 parent 103c8d1 commit 91326c5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 02xxx/02991.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>
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;
}

0 comments on commit 91326c5

Please sign in to comment.