#include using namespace std; int main() { int n, sumH=0, sumM=0; cin >> n; for (int i=0; ih) { sumH+=24-(H+1)+h; sumM+=60-M+m; } else if (H