240409 ZOAC 4

Jongleee·2024년 4월 9일
0

TIL

목록 보기
542/576
public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String input = br.readLine();
	String[] splitInput = input.split(" ");

	int H = Integer.parseInt(splitInput[0]);
	int W = Integer.parseInt(splitInput[1]);
	int N = Integer.parseInt(splitInput[2]);
	int M = Integer.parseInt(splitInput[3]);

	int f = (H - 1) / (N + 1) + 1;
	int s = (W - 1) / (M + 1) + 1;

	System.out.println(f * s);
}

출처:https://www.acmicpc.net/problem/23971

0개의 댓글