Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, d, t;
- int k = 1;
- int cur = 0;
- cin >> n >> d >> t;
- for (int i = 0; i < n; i++) {
- int x, y;
- cin >> x >> y;
- while (cur < x) {
- cur += 20;
- k += 1;
- }
- if (cur < y && cur > x) {
- cur = x;
- }
- }
- while (cur < t) {
- cur += 20;
- k += 1;
- }
- cout << k << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement