시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB197645836.250%

문제

Your friend Claire has dragged you along to a speedcubing event that is happening in Eindhoven. These events are all about solving the Rubik’s cube and similar twisty puzzles as quickly as possible. The attendants of the event can enter into various competitions based on the type and size of the puzzle, and there are even special competitions where the puzzles need to be solved one-handed or blindfolded.

Claire is competing in the most popular competition: speedsolving the 3 × 3 × 3 Rubik’s cube, pictured on the right. Each contestant needs to solve the cube five times, each time with a different random scramble. After all solves are completed, the best and the worst times are discarded and the final score is the average of the remaining three times. The contestant with the smallest final score wins.

Claire has done well in the competition so far and is among the contenders for the overall victory. All the other contestants have already finished their five solves, but Claire has one solve remaining. By looking at the final scores of the other contestants, she has deduced her own target final score. As long as her final score is less than or equal to this target score, she will be declared the overall winner. Is it possible for her to win the competition, and if so, what is the worst time she can have on her last solve in order to do so?

입력

The input consists of:

  • One line with four real numbers t1, t2, t3 and t4, the times Claire got on her first four solves.
  • One line with a real number t, Claire’s target final score, the worst final score she can have in order to be declared the overall winner.

Each number is between 1 and 20, inclusive, and is given with exactly two decimal places.

출력

If it is not possible for Claire to win the event, output “impossible”. If she will win regardless of the time she gets on her last solve, output “infinite”. Otherwise, output the worst time she can have on her last solve in order to be declared the overall winner. Output the number to exactly two decimal places.

예제 입력 1

6.38 7.20 6.95 8.11
7.53

예제 출력 1

infinite

예제 입력 2

6.38 7.20 6.95 8.11
6.99

예제 출력 2

6.82

예제 입력 3

6.38 7.20 6.95 8.11
6.45

예제 출력 3

impossible

출처

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

  • 문제를 만든 사람: Paul Wild