1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

int main()
{
    int r_end[]={24,25,26,27,29};

    int x_runda,d,h,m;
    cin>>x_runda>>d>>h>>m;

    int result=((r_end[x_runda-1]-d)*24*60)+(23-h)*60+(60-m);

    if(x_runda==5&&!(d==29&&h>2))result-=60;

    cout<<result;

    return 0;
}