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

#include<stdio.h>
int main(){
	int i,t,a,ta,b,tb,h,m;
	scanf("%d",&t);
	while(t--){
		int s=0;
		scanf("%d%d%d%d",&a,&ta,&b,&tb);
		scanf("%d:%d",&h,&m);
		for(i=300;i<1439;i+=b){
			if(i>60*h+m-tb&&i<60*h+m+ta) s++;
		}
		printf("%d\n",s);
	}
}