[Baekjoon]1297번 TV 크기

yejubi1531·2022년 3월 22일
0

Algorithm

목록 보기
2/4
post-thumbnail

1279번) TV크기
https://www.acmicpc.net/problem/1297


피타고라스 정리: c² = a² + b²


제곱과 루트 구하기

  1. 제곱 구하기 aⁿ
  • math 모듈 이용: math.pow(a,n)
  • 이용: a n
  1. 루트 구하기 √a
  • math 모듈 이용: math.sqrt(a)
  • 이용: a (1/2) or a ** 0.5

import math as m

d, h, w = map(int, input().split())
q = m.sqrt(d**2/(h**2+w**2))
#q = d / ((h ** 2 + w ** 2) ** 0.5)
print(int(h * q), int(w * q))

profile
노력하는 중

0개의 댓글