백준 풀이/자바(Java)

백준 17874 자바 - Piece of Cake!

콘스_ 2024. 5. 18. 22:22
// Piece of Cake!
package Bronze_IV_4;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Ex17874 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int h = Integer.parseInt(st.nextToken());
        int v = Integer.parseInt(st.nextToken());

        int res = Math.max(h, n - h) * Math.max(v, n - v);

        System.out.println(res * 4);
    }
}