Start: Jul, 01, 2019 08:30:00
2019年度暑期短学期第四天
End: Jul, 01, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 3ms
Memory: 1120kB
Author: 2018212212128
In contest: 1277

#include<stdio.h>
int main()
{
	int T,a,ta,b,tb,t1,t2,ans=0;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%d %d",&a,&ta);
		scanf("%d %d",&b,&tb);
		scanf("%d:%d",&t1,&t2);
		int f=t1*60+t2;
			for(int i=300; i<1440; i+=b) {
				if(i>f-tb&&i<f+ta) ++ans;
			}
			printf("%d\n",ans);
			ans=0;
	}
}