How big is the Pizza?
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 127 Accepted Submission(s) : 23
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
Xiaoming loves pizza very much! As you know, pizza is a kind of Italian open pie with circle shape , made of thin bread dough spread with a spiced mixture of tomato sauce and cheese.
Everytime Xiaoming ordered a pizza, Xiaoming always wanted to know the size of the pizza and see if the pizza shop had cheated him. He always found the pizza cut into N same pieces , in other words, each cut began from the centre point of the circle to a point on the circumference and the distance between an ending point and a neighbour ending point was the same. So, the length of each cut was the radius of the circle . In this case, Xiaoming could measure the length of a cut and got the size of the pizza easily.
But one day, Xiaoming receives a pizza that the begin point of cutting is not right in the centre of the pizza, but the ending points stay the same.(as the picture shown). Xiaoming is confused, he don’t just measure the length of a cut because he can’t get the radius in this way. He carefully measures all the N cuts ,believing it could work, but notting comes into mind, so he asks for your help.
<img src="http://m460.mail.qq.com/cgi-bin/viewfile?f=43C2E65ED528707BA5583D58EEDB095B6270A539832766F573C4C011487686C3CC758C60F0CFFB62C984B16F216E104ABFD8F5BA1E8DEB1DBC4CEFBBCACB415329BFBC1F72200706D431A54B7B2243714E28439F255ECF2177E64772AD55A34B7D550367E278C905E0C4D19B27436ABD&sid=Jyrd6M1y4PeRWEkG" />
Everytime Xiaoming ordered a pizza, Xiaoming always wanted to know the size of the pizza and see if the pizza shop had cheated him. He always found the pizza cut into N same pieces , in other words, each cut began from the centre point of the circle to a point on the circumference and the distance between an ending point and a neighbour ending point was the same. So, the length of each cut was the radius of the circle . In this case, Xiaoming could measure the length of a cut and got the size of the pizza easily.
But one day, Xiaoming receives a pizza that the begin point of cutting is not right in the centre of the pizza, but the ending points stay the same.(as the picture shown). Xiaoming is confused, he don’t just measure the length of a cut because he can’t get the radius in this way. He carefully measures all the N cuts ,believing it could work, but notting comes into mind, so he asks for your help.
<img src="http://m460.mail.qq.com/cgi-bin/viewfile?f=43C2E65ED528707BA5583D58EEDB095B6270A539832766F573C4C011487686C3CC758C60F0CFFB62C984B16F216E104ABFD8F5BA1E8DEB1DBC4CEFBBCACB415329BFBC1F72200706D431A54B7B2243714E28439F255ECF2177E64772AD55A34B7D550367E278C905E0C4D19B27436ABD&sid=Jyrd6M1y4PeRWEkG" />
Input
Input contains multiple test cases. Each test case begins with a line contain a integer N (0 <= N <= 100) , then a line contain N float numbers Li (Li<=10000) separated by a space follow , Li means the length of the i-th cut ( in clockwise ) was Li centimeters. Input will be ended by the end of file.
Output
In each case, you should output the radius of the pizza in centimeter, the answer should be rounded to four decimal digits.
Sample Input
4 4 4 4 4 4 1 5 7 5
Sample Output
4.0000 4.0000
Author
Source
2012年华南师范大学校赛初赛