Accepted
Code
import java.util.Scanner;
public class Main {
static Scanner in = new Scanner(System.in);
static int h, w;
static void solve() {
long sum = 0L;
for(int i = 1; i <= Math.min(w, h); ++i) {
sum += (h - i + 1) * (w - i + 1);
}
System.out.println(sum);
}
public static void main(String args[]) {
input();
solve();
}
private static void input() {
h = in.nextInt();
w = in.nextInt();
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1121 Square Counting Challenge
- Contest
- Brain Booster #7
- Language
- Java 8 (OpenJDK 1.8.0_422)
- Submit At
- 2024-11-05 15:00:04
- Judged At
- 2024-11-05 15:00:04
- Judged By
- Score
- 100
- Total Time
- 92ms
- Peak Memory
- 11.59 MiB