@@ -0,0 +1,999 @@
+package boj_1297;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.util.StringTokenizer;%0A%0A/**%0A * %EB%B0%B1%EC%A4%80 %EC%98%A8%EB%9D%BC%EC%9D%B8 %EC%A0%80%EC%A7%80 1297%EB%B2%88 (TV %ED%81%AC%EA%B8%B0) %EB%AC%B8%EC%A0%9C%ED%92%80%EC%9D%B4%0A *%0A * @see https://www.acmicpc.net/problem/1297%0A * @author devetude%0A */%0Apublic class Main %7B%0A%09public static void main(String args%5B%5D) throws Exception %7B%0A%09%09// %EB%B2%84%ED%8D%BC%EB%A5%BC %EC%9D%B4%EC%9A%A9%ED%95%B4 %EC%9E%85%EB%A0%A5 %EA%B0%92%EC%9D%84 %EB%B0%9B%EC%9D%8C%0A%09%09BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A%09%09StringTokenizer st = new StringTokenizer(br.readLine(), %22 %22);%0A%09%09int diagonalLen = Integer.parseInt(st.nextToken());%0A%09%09int heightRatio = Integer.parseInt(st.nextToken());%0A%09%09int widthRatio = Integer.parseInt(st.nextToken());%0A%09%09br.close();%0A%0A%09%09// %EB%B9%84%EC%9C%A8 %EA%B3%84%EC%82%B0 (%ED%94%BC%ED%83%80%EA%B3%A0%EB%9D%BC%EC%8A%A4%EC%9D%98 %EC%A0%95%EC%9D%98 a%5E2 + b%5E2 = c%5E2%EC%9D%84 %EC%9D%B4%EC%9A%A9%ED%95%98%EC%97%AC %EB%8C%80%EA%B0%81%EC%84%A0 %EB%B9%84%EC%9C%A8%EC%9D%84 %EA%B5%AC%ED%95%98%EA%B3%A0 %EC%8B%A4%EC%A0%9C %EB%B9%84%EC%9C%A8%EC%9D%84 %EA%B5%AC%ED%95%A8)%0A%09%09double ratio = diagonalLen / Math.sqrt(Math.pow(heightRatio, 2) + Math.pow(widthRatio, 2));%0A%0A%09%09// %EB%B2%84%ED%8D%BC%EB%A5%BC %EC%9D%B4%EC%9A%A9%ED%95%B4 %EA%B2%B0%EA%B3%BC %EA%B0%92 %EC%B6%9C%EB%A0%A5%0A%09%09StringBuilder sb = new StringBuilder();%0A%09%09sb.append((int) (heightRatio * ratio)).append(%22 %22).append((int) (widthRatio * ratio));%0A%09%09System.out.println(sb.toString());%0A%09%7D%0A%7D

add problem 1297