#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
double h, m;
char ch;
cin >> t;
while(t--)
{
cin >> h >> ch >> m;
double mt = (360.00 - (m*6.00))/6.00;
double hr = 360.00 - ((h*30.00) + (m*0.5));
if(hr < 0)
hr = 360 + hr;
hr = hr/30.00;
int hour = hr, minute = mt;
if(hour == 0)
cout << 12;
else if(hour < 10)
cout << 0 << hour;
else
cout << hour;
cout << ":";
if(minute == 60)
cout << "00";
else if(minute < 10)
cout << 0 << minute;
else
cout << minute;
cout << "\n";
}
return 0;
}
Comments
Post a Comment