시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB84686379.747%

문제

The famous Arora-Mitchell approximation algorithm for the Euclidean Travelling Salesman Problem (Euclidean TSP) was discovered independently by Sanjeev Arora and Joseph S. B. Mitchell in 1998. It can approximate the value of an optimal TSP tour in \(d\) dimensions within a factor of \(1 + 1/c\) in running time

\[n\left( \log { n }  \right) ^{ O\left( \left( c \sqrt{d} \right)^{d-1}  \right)  }\]

where \(n\) is the number of nodes in the tour.

Miroslava works for a computer security company and it is time to renew a shared cryptographic key in many data centres across Europe. To do this, Miroslava is going to rent a private jet and deliver the key to employees waiting at all major European airports. She wants to be back as soon as possible.

Miroslava’s company has a computer that is able to execute \(p\) billions of operations per second. Since we can approximate Europe by a two-dimensional plane, we assume that the Arora-Mitchell algorithm runs for exactly

\[\frac{n\left( \log_{2}{n} \right)^{c \sqrt{2}} }{ p \cdot 10^9}\]

seconds on this computer to produce the exact \((1 + 1/c)\)-approximation of the optimal tour.

Miroslava noticed that \(c\) is a parameter of the algorithm that can be used to her advantage, but one also needs to be very careful when choosing the right value. If she sets \(c\) too low, the algorithm will finish very fast but the time she spends flying around Europe will be too long. On the other hand, setting it too high will force her to wait for an answer from the computer, while she could be flying instead.

Miroslava used to work in a different company and from there she knows that the optimal tour of all major European airports is \(s\) meters long, but she wasn’t ranked high enough in the company to know the actual tour. Given the speed \(v\) of the private jet in meters per second, Miroslava needs \(s(1 + 1/c)/v\) seconds to complete the tour produced by the algorithm run with parameter \(c\). For the sake of simplicity, we assume that Miroslava can land, leave a copy of the private key and take off from each airport in an instant.

How long does it take Miroslava to first run the algorithm and then distribute all the keys, assuming that she chooses the optimal parameter \(c\)?

입력

The input consists of one line with four numbers:

  • an integer \(n\) (4 ≤ \(n\) ≤ 1 000 000), the number of airports;
  • a real number \(p\) (0.001 ≤ \(p\) ≤ 5 000), the number of billions of operations the computer can execute per second;
  • a real number \(s\) (106 ≤ \(s\) ≤ 109), the length of the optimal tour of all European airports in meters;
  • a real number \(v\) (50 ≤ \(v\) ≤ 900), the speed of the private jet in meters per second.

All real numbers will have at most 10 digits after the decimal point.

출력

Output one line with the shortest possible time t in seconds to distribute the keys and the value of the parameter c Miroslava should use to achieve time t. Your answer should have an absolute or relative error of at most 10−6.

예제 입력 1

10 8.9 40075000 272.1 

예제 출력 1

157079.04857106 15.598261092309

예제 입력 2

47 4.2 1337102.4 256 

예제 출력 2

5836.2936298227 8.9113418228146

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2014 E번

  • 문제를 만든 사람: Lukáš Poláček