24 lines
448 B
C++
24 lines
448 B
C++
|
#include<iostream>
|
||
|
#include<fstream>
|
||
|
using namespace std;
|
||
|
ifstream fin("order.in");
|
||
|
ofstream fout("order.out");
|
||
|
int main() {
|
||
|
long long anss,ansf;
|
||
|
int s,f;
|
||
|
fin>>anss>>ansf;
|
||
|
while (fin>>s>>f)
|
||
|
{
|
||
|
ansf-=f;
|
||
|
if(ansf<0){
|
||
|
anss--;
|
||
|
ansf+=60;
|
||
|
}
|
||
|
if(ansf>59){
|
||
|
anss++;
|
||
|
ansf-=60;
|
||
|
}
|
||
|
anss-=s;
|
||
|
}
|
||
|
fout<<anss<<":"<<ansf;
|
||
|
}
|