Advertisement
Infernale

Riding Bicycle

Dec 14th, 2018
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.     int tc, v, d, a, b;
  5.     scanf("%d", &tc);
  6.     for(int i=1;i<=tc;i++){
  7.         scanf("%d %d %d:%d", &v, &d, &a, &b);
  8.         b+=a*60;
  9.         b= ( b - ((double) d/v)*60 < 0 ? (b+1440) - ((double) d/v)*60 : b - ((double) d/v)*60);
  10.         printf("Case #%d: %.02d:%.02d\n", i, b/60, b%60);
  11.     }
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement