Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <iomanip>
- #include <algorithm>
- #include <functional>
- #include <vector>
- #include <string>
- #include <queue>
- #include <deque>
- #include <cassert>
- #include <set>
- #include <map>
- typedef long long ll;
- int main() {
- // std::ios_base::sync_with_stdio(false);
- // std::cin.tie(0); std::cout.tie(0); std::cerr.tie(0);
- int d1, t1, d2, t2;
- scanf("%d %d %d %d", &d1, &t1, &d2, &t2);
- int h, m;
- scanf("%d:%d", &h, &m);
- m += h * 60;
- int s = 5 * 60, f = 23 * 60 + 59;
- int count = 0;
- for (int begin = s; begin <= f; begin += d2) {
- const int end = begin + t2;
- // (begin, end) с (m, m+t1)
- if (end <= m || begin >= m+t1) {
- continue;
- }
- ++count;
- }
- printf("%d", count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement