From c2d01211fd19b8d383a0801aba9bf1dabf85e9d2 Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:58:44 +0900 Subject: [PATCH] =?UTF-8?q?[20260207]=20BOJ=20/=20G5=20/=20=EC=82=AC?= =?UTF-8?q?=EB=8B=A4=EB=A6=AC=20/=20=EC=9D=B4=EC=9D=B8=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...J \354\202\254\353\213\244\353\246\254.md" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "LiiNi-coder/202602/07 BOJ \354\202\254\353\213\244\353\246\254.md" diff --git "a/LiiNi-coder/202602/07 BOJ \354\202\254\353\213\244\353\246\254.md" "b/LiiNi-coder/202602/07 BOJ \354\202\254\353\213\244\353\246\254.md" new file mode 100644 index 00000000..8bd93932 --- /dev/null +++ "b/LiiNi-coder/202602/07 BOJ \354\202\254\353\213\244\353\246\254.md" @@ -0,0 +1,37 @@ +```java +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +public class Main{ + private static double X, Y, C; + + public static void main(String[] args) throws IOException{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + String[] t = br.readLine().split(" "); + X = Double.parseDouble(t[0]); + Y = Double.parseDouble(t[1]); + C = Double.parseDouble(t[2]); + double l = 0; // check(l) = true + double r = Math.min(X, Y); // check(r) = false + for(int i=0; i<100; i++){ //l, r 이 실수면 그냥 100번정도 하면 오차 내로 수렴하는 방식 + double mid = (l + r) / 2.0; + if(check(mid)){ + l = mid; + }else{ + r = mid; + } + } + + System.out.printf("%.3f\n", l); + } + + private static boolean check(double w){ + double h1 = Math.sqrt(X * X - w*w); + double h2 = Math.sqrt(Y * Y - w*w); + double cross = (h1 * h2) / (h1 + h2); + return cross >= C; + } +} + +```