12136

#include <iostream>
#include <cstdio>
#include <queue>
#include <sstream>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;

int main()
{
	int t;
	int kase=1;
	int hr1,hr2,hr3,hr4;
	int t1,t2,t3,t4;
	int mn1,mn2,mn3,mn4;
	string str1,str2,str3,str4;
	scanf("%d",&t);

	while(t--)
	{
		cin>>str1>>str2;
		cin>>str3>>str4;

		hr1=hr2=hr3=hr4=0;
		mn1=mn2=mn3=mn4=0;

		hr1=str1[0]-'0';hr1*=10;
		hr1+=(str1[1]-'0');

		hr2=str2[0]-'0';hr2*=10;
		hr2+=(str2[1]-'0');

		hr3=str3[0]-'0';hr3*=10;
		hr3+=(str3[1]-'0');

		hr4=str4[0]-'0';hr4*=10;
		hr4+=(str4[1]-'0');

		mn1=str1[3]-'0';mn1*=10;
		mn1+=(str1[4]-'0');

		mn2=str2[3]-'0';mn2*=10;
		mn2+=(str2[4]-'0');

		mn3=str3[3]-'0';mn3*=10;
		mn3+=(str3[4]-'0');

		mn4=str4[3]-'0';mn4*=10;
		mn4+=(str4[4]-'0');

		t1 = hr1*60+mn1;
		t2 = hr2*60+mn2;
		t3 = hr3*60+mn3;
		t4 = hr4*60+mn4;

		/*
		if(hr3>=hr1 && hr3<=hr2)
		{
			printf("Case %d: Mrs Meeting\n",kase++);
		}
		else if(hr3==hr2)
		{
			if(mn3<=mn2)
			printf("Case %d: Mrs Meeting\n",kase++);
			else
			printf("Case %d: Hits Meeting\n",kase++);
		}
		else if(hr4==hr1)
		{
			if(mn1<=mn4)
			printf("Case %d: Mrs Meeting\n",kase++);
			else
			printf("Case %d: Hits Meeting\n",kase++);
		}
		else
		printf("Case %d: Hits Meeting\n",kase++);
		*/
		if(t1>=t3 && t1<=t4)
		printf("Case %d: Mrs Meeting\n",kase++);
		else if(t3>=t1 && t3<=t2)
		printf("Case %d: Mrs Meeting\n",kase++);
		else
		printf("Case %d: Hits Meeting\n",kase++);

	}
	return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *