link/cut tree
[kudsource.git] / POJ / 2840.cc
blob0f1dc274e0ea5587e1ba2fde66fc2ceb19b14f25
1 #include <cstdio>
3 using namespace std;
5 int main()
7 int tcase;
8 scanf("%d",&tcase);
9 while (tcase--)
11 int a,b;
12 scanf("%d:%d",&a,&b);
13 if (b>0) puts("0"); else
14 if (a==12) puts("24"); else
15 printf("%d\n",(a+12)%24);
17 return 0;