# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
197871 | 2020-01-23T20:41:58 Z | 2u_my_light | 개미 (GA4_ant) | Java 11 | 0 ms | 0 KB |
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()); } } }