//Tadeusz Bindas
#include <iostream>
int main()
{
int x, d, h, m;
bool a = false, b = false, c = false;
std::cin >> x >> d >> h >> m;
if (x == 5)
{
a = true;
if (d == 29 && h > 2)
c = true;
}
if (d > 22 + x)
b = true;
std::cout << (a?1380:0) + 2160 - (b ? 720 : 0) - (b?(d-23-x)*1440:0) - (b ? h * 60 : (h - 12) * 60) - m + (c?60:0) << std::endl;
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | //Tadeusz Bindas #include <iostream> int main() { int x, d, h, m; bool a = false, b = false, c = false; std::cin >> x >> d >> h >> m; if (x == 5) { a = true; if (d == 29 && h > 2) c = true; } if (d > 22 + x) b = true; std::cout << (a?1380:0) + 2160 - (b ? 720 : 0) - (b?(d-23-x)*1440:0) - (b ? h * 60 : (h - 12) * 60) - m + (c?60:0) << std::endl; return 0; } |
English