-
Notifications
You must be signed in to change notification settings - Fork 0
/
BOJ_11880.java
26 lines (25 loc) · 897 Bytes
/
BOJ_11880.java
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
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
private void solution() throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int tc = Integer.parseInt(br.readLine());
StringBuilder sb = new StringBuilder();
while (tc-->0) {
StringTokenizer st = new StringTokenizer(br.readLine());
int sum = 0;
int max = 0;
for (int i = 0; i < 3; i++) {
int cur = Integer.parseInt(st.nextToken());
sum += cur;
max = Math.max(max, cur);
}
sb.append(1l*max*max+1l*(sum-max)*(sum-max)).append('\n');
}
System.out.println(sb);
}
public static void main(String[] args) throws Exception {
new Main().solution();
}
}