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: 2018212212050
In contest: 1277

#include <stdio.h>

int main() {
	int T,a,ta,b,tb;
	int hh,mm,ms;
	int m0,m1,ccj,xc,total;
	m0=300;
	scanf("%d",&T);
	while(T--)
	{
		total=0;
		scanf("%d %d",&a,&ta);
		scanf("%d %d",&b,&tb);
		scanf("%d:%d",&hh,&mm);
		m1=hh*60+mm;
		for(xc=300;xc<1440;xc+=b)
		{
			if(xc>m1-tb&&xc<m1+ta)
			{
				total+=1;
			}
		}
		printf("%d\n",total);
	}
	return 0;
}