-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathC.java
More file actions
26 lines (23 loc) · 855 Bytes
/
Copy pathC.java
File metadata and controls
26 lines (23 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package atcoder.aising;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public final class C {
public static void main(String[] args) {
final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
final int n = Integer.parseInt(in.nextLine());
final Map<Integer, Integer> squares = new HashMap<>();
for (int i = 1; i <= 150; i++) {
for (int j = 1; j <= 150; j++) {
for (int k = 1; k <= 150; k++) {
squares.merge((i + j) * (i + j) + (i + k) * (i + k) + (j + k) * (j + k), 1, Integer::sum);
}
}
}
for (int i = 1; i <= n; i++) {
System.out.println(squares.getOrDefault(2 * i, 0));
}
}
}