Kitchen Cable Chaos

케이블 길이들과 목표 거리가 주어질 때, 겹침이 5cm를 넘지 않도록 일부 케이블을 골라 이어 붙여 최소 겹침을 최대화하고, 불가능하면 impossible을 출력한다.

어려움8이분 탐색그리디정렬아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

You started your new project: installing a home automation system. You already bought all the components and in your local electronic shop you found a promotion set with a bunch of cables of different lengths. Now you want to connect your controller with your smart sandwich maker that is several meters away, but you are lacking a cable that is long enough.

To solve this problem you have to connect some of your cables to form a long one. You measure the lengths of every cable you own. Exactly 5 centimeters of isolation are stripped on both ends of every cable. To connect two cables, you overlap and twist the stripped ends. It is enough for the cables to touch each other with an overlap of 0. You cannot have an overlap of more than 5 centimeters, but the connection quality increases with longer overlaps. On both ends – the controller and the sandwich maker – you also have 5 centimeters of stripped end, to which you have to connect your newly created cable in the same way. The connection quality of your link is determined by the smallest overlap used and your goal is to maximize this value.

The problem would be really easy, but your perfectionist roommate hates unnecessary use of cables. Therefore, the cable has to form a straight line, without any loops or detours. And cutting the cables is no option, obviously.

Figure K.1: Four cables of different lengths connect the controller with the sandwich maker, with different overlaps. Connection 1 has the maximal overlap, connection 2 the minimal overlap and all other connections are in between. The quality of this setup is 0.

Considering all possible arrangements of cables, find the one with the best quality.

입력

The input consists of:

  • one line with two integers n, g (1 ≤ n ≤ 60, 11 ≤ g ≤ 1 000), the number of cables and the distance to be covered in centimeters, measured between the casings of the controller and the sandwich maker;
  • n lines, each with an integer d (11 ≤ d ≤ 1 000), giving the lengths of the cables (including the stripped ends).

Each of the n cables can be used at most once.

출력

Output one number, the best achievable quality. The quality must be accurate up to a relative or absolute error (whichever is lower) of 10−7. If no arrangement fits your needs, output impossible.