using namespace std;
int main()
{
int T,h,m,ans;
cin>>T;
while(T--)
{
scanf("%d:%d", &h, &m);
int tt = h*60 + m;
ans = 1440 - tt;
ans %= 720; /// its a 12 hr clock so, mod by 720
int hh = ans/60, mm = ans%60;
if(hh == 0) hh+=12; /// bcoz of 12 hr clock , we dont' have any 0 hour.. we've 12 hr so..
printf("%02d:%02d\n", hh, mm);
}
return 0;
}
No comments:
Post a Comment