409148: GYM103446 M Harmony in Harmony

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

M. Harmony in Harmonytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Haha is a humorous god of harmony. Why do I say that? In fact, Haha is forgetful, but Haha thinks that he has an excellent memory. Haha is responsible for balancing the power of various elements in the world. The power is derived from harmony fruits which grow in Hahiland. There are $$$n$$$ tribes in Hahiland, each takes charge of one element, such as fire, water, etc. There is a fertile field in Hahiland, where the soil is suitable for growing the harmony fruits.

Every spring, Haha will divide the field into $$$n$$$ parts, and each part is of the same total area. Then every tribe will choose one part to be their territory, then sow the harmony seeds on it, and give some element power to the seeds. Although the element power helps the plants to grow well, when the fruits are ripe, they could only be harvested by the one who has the same kind of element power.

"My memory is very good. I don't need to record my divide plan at all! These are all in my brain clearly!" Haha said with full confidence. As autumn comes, Haha divides the field into $$$n$$$ parts again from his memory. But it's actually not the same as last time. People are afraid to tell the harmony god that he is wrong. So they discuss how to allot the $$$n$$$ parts in order to guarantee the minimum area of plants each tribe could harvest to be as large as possible.

The members of Hahiland are wondering how large the minimum area of plants each tribe could harvest could be guaranteed no matter how Haha divides the field, for their future generations. Please calculate it with your wisdom, so that they will be not so anxious.

In short, given $$$n$$$, determine: $$$$$$\min\limits_{S, A}\{\max\limits_{p}\{\min\limits_{i=1}^{n}\{|S_i\cap A_{p_i}| \}\}\}$$$$$$ , where $$$S, A$$$ denote the field parts(the whole field and the parts can be denoted by some areas in 2D plane) divided in spring and autumn respectively(so $$$|S_1| = |S_2| = \cdots = |S_n| = |A_1| = |A_2| = \cdots = |A_n|$$$ holds), $$$p$$$ denotes a permutation of $$$\{1,2,\cdots,n\}$$$(so $$$\{p_1, p_2, \cdots, p_n\} = \{1, 2, \cdots, n\}$$$ holds).

Moreover, assume the total area of the whole field is 1 and the shape of the whole field doesn't count in this problem as can be seen.

Input

Input one line containing one integer $$$n\,(1\leq n\leq 500)$$$, denoting the number of tribes.

Output

Output one line containing one real number round to 9 digits after the decimal point, denoting the answer.

ExamplesInput
1
Output
1.000000000
Input
2
Output
0.250000000

加入题单

算法标签: