https://www.acmicpc.net/problem/2525
#include <iostream> using namespace std; int main() { int h,m,n; cin>>h>>m>>n; int sum=m+n; h+=sum/60; sum%=60; h%=24; cout<<h<<" "<<sum; }