백준 10250번 자바 : ACM 호텔

Rena·2022년 3월 6일
0

알고리즘 문제풀이

목록 보기
3/45
import java.util.Scanner;

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();
			int floor;
			int number;

			if(n%h == 0) {
				floor = h;
				number = n/h;
			} else {
				floor = n%h;
				number = n/h + 1;
			}
			System.out.println(100*floor + number);
		}
		sc.close();
	}
}

n%h 이 0일 때를 고려해야 함!!

profile
일을 사랑하고 싶은 개발자

0개의 댓글