Baekjoon - 1297

Tadap·2023년 11월 21일
0

Baekjoon

목록 보기
87/94

문제

Solved.ac Bronze2

구름톤 트레이닝을 진행하며 같이 푼 문제이다

1차시도

public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] split = br.readLine().split(" ");
		int d = Integer.parseInt(split[0]);
		int h = Integer.parseInt(split[1]);
		int w = Integer.parseInt(split[2]);

		System.out.println(solve(h, w, d));
	}

	public static String solve(double h, double w, double d) {
		double sqrt = Math.sqrt((d * d) / ((h * h) + (w * w)));
		return (int)(sqrt * h) + " " + (int)(sqrt * w);
	}
}

성공

0개의 댓글