import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int hour = Integer.parseInt(st.nextToken());
int minuit = Integer.parseInt(st.nextToken());
int time = Integer.parseInt(br.readLine());
int result = hour * 60 + minuit + time;
if(result >= (24 * 60)) result -= 24 * 60;
hour = result / 60;
minuit = result % 60;
System.out.println(hour + " " + minuit);
br.close();
}
}
'Coding Test > 백준' 카테고리의 다른 글
[백준/자바] 10871 - X보다 작은 수 (0) | 2023.05.06 |
---|---|
[백준/자바] 2480 - 주사위 세개 (0) | 2023.05.06 |
[백준/자바] 2884 - 알람 시계 (0) | 2023.05.06 |
[백준/자바] 11382 - 꼬마 정민 (0) | 2023.05.05 |
[백준/자바] 11660 - 구간 합 구하기 5 (0) | 2023.05.05 |