Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- by: senb1 aka amigo
- */
- #include <bits/stdc++.h>
- #define ll long long
- #define ull unsigned long long
- #define all(x) x.begin(), x.end()
- #define fr first
- #define sc second
- #define mk make_pair
- #define rall(x) x.rbegin(), x.rend()
- #define endl '\n'
- #define print(x) cout << x << endl
- using namespace std;
- const ll mod = 1000;
- const ll maxn = 5e8;
- const ll inf = 1e9 + 6;
- void solve() {
- ll m;
- cin >> m;
- vector<ll> a(5), b(5);
- for (ll i = 0; i < 5; i++)
- cin >> a[i] >> b[i];
- ll ans = 0, mm = 0;
- while (mm < m) {
- if (ans >= a[0] * 10 and ans < b[0] * 10 and mm >= 60 and mm < 120)
- ans += 1;
- else if (ans >= a[1] * 10 and ans < b[1] * 10 and mm >= 60 and mm < 120)
- ans += 1;
- else if (ans >= a[2] * 10 and ans < b[2] * 10 and mm >= 60 and mm < 120)
- ans += 1;
- else if (ans >= a[3] * 10 and ans < b[3] * 10 and mm >= 60 and mm < 120)
- ans += 1;
- else if (ans >= a[4] * 10 and ans < b[4] * 10 and mm >= 60 and mm < 120)
- ans += 1;
- else
- ans += 10;
- mm++;
- }
- cout << ans << "00" << endl;
- }
- /*
- 64 60 62 70 71 100 105 106 107 120 130
- 60 1 2 3 4 5 6 7 8 9 10
- */
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- int t = 1;
- // cin >> t;
- while (t--) {
- solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment