https://www.acmicpc.net/problem/2884
45분 미만이면 1시간 전으로 넘어가고 15분을 더한다.(45분을 뺄 수 없으니 60분을 가져온다.)
시간이 0시일때에서 45분을 빼면 23시로 넘어간다.
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int h = sc.nextInt();
int m = sc.nextInt();
sc.close();
if(m < 45){
if(h == 0) System.out.println(23 + " " + (m+15));
else System.out.println((h-1) + " " + (m+15));
}
else System.out.println(h + " " + (m-45));
}
}