Logo
(追記) (追記ここまで)

21192번 - Solar Energy 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
9 초 1024 MB6000.000%

문제

You are planning to travel in interstellar space in the hope of finding habitable planets. You have already identified $N$ stars that can recharge your spaceship via its solar panels. The only work left is to decide the orientation of the spaceship that maximizes the distance it can travel.

Space is modeled as a 2D plane, with the Earth at the origin. The spaceship can be launched from the Earth in a straight line, in any direction. Star $i$ can provide enough energy to travel $T_i$ distance if the spaceship is launched at an angle of $a_i$ with the $x$-axis. If the angle is not perfectly aligned, then the spaceship gets less energy. Specifically, if the launch direction makes an angle of $a$ with the $x$-axis, then it gets enough energy to travel distance of \[\max(0, T_i - s_i \cdot \mathrm{dist}(a_i, a))\] from star $i,ドル where $\mathrm{dist}(a,b)$ is the minimum radians needed to go from angle $a$ to $b$. The distance that the spaceship can travel is simply the sum of the distances that each star contributes. Find the maximum distance $T$ that the starship can travel.

입력

The first line contains the value $N,ドル 1ドル\le N\le 10^5$. Following this are $N$ lines each containing three real numbers $T_i,ドル $s_i,ドル and $a_i,ドル with 0ドル<T_i\le 1,000円,ドル 0ドル\le s_i\le 100,ドル and 0ドル\le a_i < 2\pi$. All real numbers in the input have at most 6ドル$ digits after the decimal point.

출력

On a single line output the maximum distance the spacecraft can travel. Your answer is considered correct if it has an absolute or relative error of at most 10ドル^{-6}$.

제한

예제 입력 1

2
100 1 1
100 1 1.5

예제 출력 1

199.500000

예제 입력 2

4
100 1 0.5
200 1 1
100 0.5 1.5
10 2 3

예제 출력 2

405.500000

힌트

출처

ICPC > Regionals > North America > North Central North America Regional > NCNA 2019 K번

  • 문제를 만든 사람: Jaehyun Park
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /