/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
private int clock, min, cook;
Time(int clock,
int min,
int cook
){ this.clock = clock;
this.min = min;
this.cook = cook;
}
public void CookTimeCheck() { //요리 시간 계산
for(; cook >= 60; cook -= 60) //요리 시간이 1시간 이상인 경우
ClockTimeCheck(); //시 단위만 증가
if(cook > 0) //그 외의 경우 분 단위만 증가
MinTimeCheck();
}
private void ClockTimeCheck() { //시 단위 증가
if((clock += 1) > 23)
clock = 0;
}
private void MinTimeCheck() { //분 단위 증가
if((min += cook) > 59) {
min -= 60;
ClockTimeCheck();
}
}
public int getClock() {
return clock;
}
public int getMin() {
return min;
}
}
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Scanner sc
= new Scanner
(System.
in); Time t
= new Time(sc.
nextInt(), sc.
nextInt(), sc.
nextInt()); t.CookTimeCheck();
System.
out.
println(t.
getClock() + " " + t.
getMin()); sc.close();
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBUaW1lewoJcHJpdmF0ZSBpbnQgY2xvY2ssIG1pbiwgY29vazsKCQoJVGltZShpbnQgY2xvY2ssIGludCBtaW4sIGludCBjb29rKXsKCQl0aGlzLmNsb2NrID0gY2xvY2s7CgkJdGhpcy5taW4gPSBtaW47CgkJdGhpcy5jb29rID0gY29vazsKCX0KCQoJcHVibGljIHZvaWQgQ29va1RpbWVDaGVjaygpIHsJCS8v7JqU66asIOyLnOqwhCDqs4TsgrAKCQlmb3IoOyBjb29rID49IDYwOyBjb29rIC09IDYwKQkvL+yalOumrCDsi5zqsITsnbQgMeyLnOqwhCDsnbTsg4Hsnbgg6rK97JqwCgkJCUNsb2NrVGltZUNoZWNrKCk7CQkJLy/si5wg64uo7JyE66eMIOymneqwgAo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