Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int vis[1000];
- int main(){
- int A, T, B;
- cin >> A >> T >> B;
- int cur = 0;
- for (int i = 0; i < A; i++) {
- while (vis[cur] == 1) cur++;
- cur = cur + 1;
- vis[cur + 5] = 1;
- }
- if (cur < T) cur = T;
- for (int i = 0; i < B; i++) {
- while (vis[cur] == 1) cur++;
- cur = cur + 1;
- vis[cur + 5] = 1;
- }
- for (int i = 999; i >= 0; i--) {
- if (vis[i]) {
- cout << i + 1 << endl;
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement