/* coder: ACboy date: 2010-3-5 result: AC description: UVa 579 - ClockHands */ #include <iostream> #include <cmath> using namespace std; char input[6]; int main() { #ifndef ONLINE_JUDGE freopen("579.txt", "r", stdin); #endif while (gets(input)) { int hour, minute; if (strcmp(input, "0:00") == 0) break; sscanf(input, "%d:%d", &hour, &minute); double hourAngle = (hour * 60 + minute) / 2.0; double minuteAngle = minute * 6.0; double ans1 = fabs(hourAngle - minuteAngle); double ans2 = 360 - ans1; double ans = ans1 > ans2 ? ans2 : ans1; printf("%.3lf/n", ans); } return 0; }