| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 197871 | 2u_my_light | 개미 (GA4_ant) | Java | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
InputReader in = new InputReader();
StringBuilder out = new StringBuilder();
int T = in.nextInt();
while (T-- > 0) {
long a = in.nextInt();
long b = in.nextInt();
long c = in.nextInt();
long min = Integer.MAX_VALUE;
min = Math.min(min, a * a + (b + c) * (b + c));
min = Math.min(min, b * b + (c + a) * (c + a));
min = Math.min(min, c * c + (a + b) * (a + b));
out.append(min + "\n");
}
System.out.print(out);
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer st;
public InputReader() {
reader = new BufferedReader(new InputStreamReader(System.in));
}
public String next() {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(nextLine());
}
return st.nextToken();
}
public String nextLine() {
try {
return reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public int nextInt() {
return Integer.parseInt(next());
}
}
}
