백준: 10250(ACM 호텔)

강지안·2023년 6월 27일
0

baekjoon

목록 보기
74/186

문제

코드

import java.util.Scanner;

public class q10250 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();

        for(int i=0; i<T; i++) {
            int floor = sc.nextInt();
            int number = sc.nextInt();
            int person = sc.nextInt();

            if(person % floor == 0) {
                System.out.print(floor);
                System.out.printf("%02d\n", person / floor);
            } else {
                System.out.print(person % floor);
                System.out.printf("%02d\n", person / floor + 1);
            }
        }
    }
}

0개의 댓글