![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Cutting Necklace Time Limit:20000MS Memory Limit:65536K
Today is Valentine's Day. Gnaf Ynot is going to present a beautiful
necklace to his girl friend Mxxjx. He has bought a necklace of pearls
some time ago. The necklace consists of many sheeny pearls and is very
pretty. However, the necklace is too long for his girl friend. So Gnaf
Ynot has to cut a slice from the necklace so that he can get a shorter
one. He wants that the cut slice of necklace can be as evenly bright as
possible, i.e. the average brightness of the slice should be maximized.
Gnaf Ynot requests your help.
Input contains multiple test cases. Each test case starts a line containing three numbers N, L, U (1 <= L <= U <= N <= 1000000), which are the number of pearls of the necklace, the permitted shortest length and the longest length of the cut slice. Then the following line gives the brightness of each pearl (the value of brightness are integers and in the range of [-1000, 1000]). OutputFor each test case print the largest average brightness of the slice you cut from the necklace in one line. The result should be represented using fraction form such as A/B (here A and B are integers, B > 0 and (A, B) = 1). Sample Input
POJ Monthly--2005.07.31, CHEN Shixi |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator