본문 바로가기
Java/알고리즘

[Java] 백준 10250번 : ACM 호텔

by EricJeong 2019. 8. 21.

 

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int i=0; i<T; i++) {
			int H = in.nextInt();
			int W = in.nextInt();
			int N = in.nextInt();
			
			String answer = "";
			int x = (N-1) / H + 1;
			int y = (N-1) % H + 1;
			
			System.out.println(y + "" + (x<10? "0"+x : x));
			
		}
	}
}

 

 

 

 

댓글