Shrine Maintenance

No attempts yetTime limit2sMemory limit256 MB

Problem

A religious sect builds shrines along a circle of radius 1000. The circle is cut into NN arcs of equal length, and the NN division points are numbered 1 through NN in order. When NN is 12, the points sit like the marks on a clock face.

Every circle has one or more sacred numbers. A sacred number is a divisor of NN and is smaller than NN. A shrine stands at each point whose number is a multiple of at least one sacred number. When NN is 12 and the sacred numbers are 2 and 3, the shrines are at points 2, 3, 4, 6, 8, 9, 10, and 12.

On an inspection day the site closes and WW workers leave the maintenance shed at the center of the circle at the same time. A worker visits every shrine assigned to that worker and then returns to the shed. Workers move in straight lines and distance is Euclidean. Each worker takes a shortest route that visits all the shrines assigned to that worker. Every shrine is assigned to at least one worker.

The site reopens only after the last worker is back at the shed, so the shrines have to be divided so that the distance walked by the worker who walks farthest is as small as possible. Find that smallest distance. When NN is 12, the sacred numbers are 2 and 3, and 3 workers are available, the answer is about 3517.6.

Input

The input holds one or more data sets. Each data set is one line of positive integers. The first three numbers are the number of workers WW, the number of equal arcs NN, and the number of sacred numbers DD, followed by the DD sacred numbers.

WW is at most the total number of shrines, N8600N \le 8600, and D6D \le 6. Every sacred number is a divisor of NN and is smaller than NN.

The last line holds a single 0 and means the input has ended.

Output

For each data set print one line with the greatest distance a worker has to walk when the shrines are divided as well as possible. Round the value to one decimal place and always print that decimal place, even when it is 0.

The data is chosen so that every value within 0.005 of the exact minimum rounds to the same answer.

One input can hold many data sets, so the algorithm has to be fast enough.