#include<stdio.h>
#include<string.h>
int main()
{
int t,ns,pd,i,reqd=0,tcase=1,j,rd[102],chk=0;//pd=permit day
char sub[102][22];
char subj[22];
//freopen("in.txt","r",stdin);
scanf("%d",&t);
for(j=0;j<t;j++)
{
scanf("%d",&ns);
for(i=0;i<ns;i++)
{
scanf("%s",sub[i]);
scanf("%d",&rd[i]);
}
scanf("%d",&pd);
scanf("%s",subj);
for(i=0;i<ns;i++)
{
if(!strcmp(sub[i],subj))
{
chk=1;
reqd=rd[i];
break;
}
}
if(pd>=reqd && chk!=0)
printf("Case %d: Yesss\n",tcase++);
else if(reqd > pd && reqd<=(pd+5) && chk!=0)
printf("Case %d: Late\n",tcase++);
else if(chk==0)
printf("Case %d: Do your own homework!\n",tcase++);
else
printf("Case %d: Do your own homework!\n",tcase++);
reqd=0;
chk=0;
}
return(0);
}
No comments:
Post a Comment