import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i = 0; i < t; i++) {
int h = sc.nextInt();// 층 수
int w = sc.nextInt();// 방 수
int n = sc.nextInt();// n번째 손님
int guestH = n % h; // n번째 손님 층 수
int guestW = n / h + 1; // n번째 손님 방 수
if (n % h == 0) {
guestH = h;
guestW = n / h;
}
System.out.println(guestH + String.format("%02d", guestW));
}
}
}
'알고리즘 > 백준' 카테고리의 다른 글
백준 1978 소수 찾기 자바 (0) | 2019.12.02 |
---|---|
백준 2775 부녀회장이 될거야 자바 (0) | 2019.11.20 |
백준 2869 달팽이는 올라가고 싶다 자바 (0) | 2019.11.04 |
백준 1011 Fly me to the Alpha Centauri 자바 (0) | 2019.11.02 |
백준 1193 분수 찾기 자바 (0) | 2019.10.31 |
댓글