1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
int tab[6] = { 0, 
((24 * 24 + 24) * 60),//1
((25 * 24 + 24) * 60),//2
((26 * 24 + 24) * 60),//2
((27 * 24 + 24) * 60),//2
((29 * 24 + 23) * 60),//2
};
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int x, d, h, m;
    cin >> x >> d >> h >> m;
    int t = (d * 24 + h) * 60 + m;
    if (d == 29 and h > 2)
        tab[5] += 60;
    cout << tab[x] - t;//<<" | "<<(tab[x] - t)/60;
    
}