Created
December 8, 2017 21:31
-
-
Save chermehdi/3ebadf31e29e0a0bf115a09e965f669c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
int t, h, m, x; | |
scanf("%d", &t); | |
while(t--){ | |
scanf("%d:%d %d", &h, &m, &x); | |
while(x){ | |
m--; | |
if(m == -1){ | |
h--; | |
m = 59; | |
if(h == -1){ | |
h = 23; | |
} | |
} | |
x--; | |
} | |
printf("%02d:%02d\n", h, m); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment