Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int tc, v, d, a, b;
- scanf("%d", &tc);
- for(int i=1;i<=tc;i++){
- scanf("%d %d %d:%d", &v, &d, &a, &b);
- b+=a*60;
- b= ( b - ((double) d/v)*60 < 0 ? (b+1440) - ((double) d/v)*60 : b - ((double) d/v)*60);
- printf("Case #%d: %.02d:%.02d\n", i, b/60, b%60);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement