#include #include using namespace std; using lint=int64_t; int main() { int N,H,M,T; cin >> N >> H >> M >> T; int time=0; time=H*60+M; for(int i=0;i