#include int main() { int sleep = 0; int hour = 0; int minits = 0; int snooze = 0; scanf("%d %d %d %d", &sleep, &hour, &minits, &snooze); minits += ((sleep - 1) * snooze); hour += (minits / 60); minits %= 60; hour %= 24; printf("%d\n%d", hour, minits); return 0; }