#include <iostream>
#include <iomanip>
class Time {
private:
int hours;
int minutes;
public:
Time() : hours(0), minutes(0) {}
void setTime(int h, int m) {
if (h >= 0 && h < 24 && m >= 0 && m < 60) {
hours = h;
minutes = m;
}
else {
std::cout << "taxminiy vaqt:" << std::endl;
}
}
void addMinutes(int m) {
if (m < 0) {
std::cout << "qo'shiladigan vaqt minutlarda:" << std::endl;
return;
}
minutes += m;
hours += minutes / 60;
minutes %= 60;
hours %= 24;
}
void getTime() const {
std::cout << "hozirgi vaqt: " << std::setw(2) << std::setfill('0') << hours << ":"
<< std::setw(2) << std::setfill('0') << minutes <<std::endl;
}
};
int main() {
Time time;
time.setTime(19,35);
time.getTime();
time.addMinutes(120);
time.getTime();
return 0;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGlvbWFuaXA+CmNsYXNzIFRpbWUgewpwcml2YXRlOgogICAgaW50IGhvdXJzOwogICAgaW50IG1pbnV0ZXM7CnB1YmxpYzoKICAgIFRpbWUoKSA6IGhvdXJzKDApLCBtaW51dGVzKDApIHt9CiAgICB2b2lkIHNldFRpbWUoaW50IGgsIGludCBtKSB7CiAgICAgICAgaWYgKGggPj0gMCAmJiBoIDwgMjQgJiYgbSA+PSAwICYmIG0gPCA2MCkgewogICAgICAgICAgICBob3VycyA9IGg7CiAgICAgICAgICAgIG1pbnV0ZXMgPSBtOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgc3RkOjpjb3V0IDw8ICJ0YXhtaW5peSB2YXF0OiIgPDwgc3RkOjplbmRsOwogICAgICAgIH0KICAgIH0KICAgIHZvaWQgYWRkTWludXRlcyhpbnQgbSkgewogICAgICAgIGlmIChtIDwgMCkgewogICAgICAgICAgICBzdGQ6OmNvdXQgPDwgInFvJ3NoaWxhZGlnYW4gdmFxdCBtaW51dGxhcmRhOiIgPDwgc3RkOjplbmRsOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIG1pbnV0ZXMgKz0gbTsKICAgICAgICBob3VycyArPSBtaW51dGVzIC8gNjA7IAogICAgICAgIG1pbnV0ZXMgJT0gNjA7IAogICAgICAgIGhvdXJzICU9IDI0OwogICAgfQogICAgdm9pZCBnZXRUaW1lKCkgY29uc3QgewogICAgICAgIHN0ZDo6Y291dCA8PCAiaG96aXJnaSB2YXF0OiAiIDw8IHN0ZDo6c2V0dygyKSA8PCBzdGQ6OnNldGZpbGwoJzAnKSA8PCBob3VycyA8PCAiOiIKICAgICAgICAgICAgPDwgc3RkOjpzZXR3KDIpIDw8IHN0ZDo6c2V0ZmlsbCgnMCcpIDw8IG1pbnV0ZXMgPDxzdGQ6OmVuZGw7CiAgICB9Cn07CmludCBtYWluKCkgewogICAgVGltZSB0aW1lOwogICAgdGltZS5zZXRUaW1lKDE5LDM1KTsKICAgIHRpbWUuZ2V0VGltZSgpOwogICAgdGltZS5hZGRNaW51dGVzKDEyMCk7IAogICAgdGltZS5nZXRUaW1lKCk7CiAgICByZXR1cm4gMDsKfSAKICA=