提交时间:2026-02-01 10:22:57

运行 ID: 377502

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); // 行 int m = sc.nextInt(); // 列 sc.close(); // 核心公式:(n*m +1)/2 整数除法实现向上取整(Java中int相除自动取整) int max = (n * m + 1) / 2; System.out.println(max); } }