시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 11 8 8 80.000%

문제

모형 로켓이 얼마나 높이 올라갔는지 측정하는 방법은 여러가지가 있는데, 그 중 하나는 다음과 같다.

관측하는 사람 A,B,C가 D 만큼 떨어져서 경위계를 가지고, 수평선에서 떨어진 각도를 측정한다. 각 측정 장비는 지면에서 H만큼 떨어져 있다. 로켓이 발사된 후 가장 높은 지점 근처에서, 낙하산을 펼친 후, 먼지 더미를 분출한다. 각각의 관측자는 먼지 더미와 수평선과의 각도를 측정한다.

A,B,C가 측정한 각을 각각 a,b,c라 하면 이 값을 이용하여 높이를 측정할 수 있다.

D,H,a,b,c가 주어졌을 때, 로켓이 올라간 높이(반올림)를 계산하는 프로그램을 작성하시오.

입력

첫 줄은 10진수 D,H가 들어온다. (정수가 아닐 수 있다) 이 값들은 모든 로켓에 대해 같다. 다음 줄부터 각 줄에는 a,b,c(각도)가 들어오며, 마지막 줄에는 0보다 작거나 같은 값이 들어온다. 입력의 마지막을 나타내는 마지막 줄을 제외하고는 모두 0도 초과부터 90도 미만 사이의 각이다.

출력

각각의 3개의 각에 대해 높이를 반올림 하여 정수로 출력한다.

예제 입력 1

50 4
43.88 46.85 40.70
34.52 39.50 35.43
27.05 29.22 26.14
0 0 0

예제 출력 1

90
70
60

힌트

W3sicHJvYmxlbV9pZCI6IjI3NjEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJhYThcdWQ2MTUgXHViODVjXHVjZjEzXHVjNzU4IFx1YjE5Mlx1Yzc3NCIsImRlc2NyaXB0aW9uIjoiPHA+XHJcblx0XHViYWE4XHVkNjE1IFx1Yjg1Y1x1Y2YxM1x1Yzc3NCBcdWM1YmNcdWI5YzhcdWIwOTggXHViMTkyXHVjNzc0IFx1YzYyY1x1Yjc3Y1x1YWMxNFx1YjI5NFx1YzljMCBcdWNlMjFcdWM4MTVcdWQ1NThcdWIyOTQgXHViYzI5XHViYzk1XHVjNzQwIFx1YzV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