{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003ch4\u003eBackground\u003c/h4\u003e\n\u003cp\u003e\n\u003cfont size\u003d\"2\"\u003e\u003cem\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.\n\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him. \n\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my brother\u0027s keeper?\n\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;And he said, What hast thou done? the voice of thy brother\u0027s blood crieth unto me from the ground.\n\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;And now art thou cursed from the earth, which hath opened her mouth to receive thy brother\u0027s blood from thy hand;\n\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;When thou tillest the ground, it shall not henceforth yield unto thee her strength; a fugitive and a vagabond shalt thou be in the earth.\n\u003c/em\u003e\u003c/font\u003e\u003c/p\u003e\u003cfont size\u003d\"2\"\u003e\u003cem\u003e\n\u003c/em\u003e\u003c/font\u003e\u003cp align\u003d\"right\"\u003e\u003cfont size\u003d\"2\"\u003e\u003cem\u003e —— Bible Chapter 4\u003c/em\u003e\u003c/font\u003e\u003c/p\u003e\n\n\u003cp\u003e\nNow Cain is unexpectedly trapped in a cave with \u003cvar\u003eN\u003c/var\u003e paths. Due to LORD\u0027s punishment, all the paths are zigzag and dangerous. The difficulty of the \u003cvar\u003eith\u003c/var\u003e path is \u003cvar\u003eci\u003c/var\u003e. \n\u003c/p\u003e\n\u003cp\u003e\nThen we define \u003cvar\u003ef\u003c/var\u003e as the fighting capacity of Cain. Every day, Cain will be sent to one of the \u003cvar\u003eN\u003c/var\u003e paths randomly.\n\u003c/p\u003e\n\u003cp\u003e\nSuppose Cain is in front of the \u003cvar\u003eith\u003c/var\u003e path. He can successfully take \u003cvar\u003eti\u003c/var\u003e days to escape from the cave as long as his fighting capacity \u003cvar\u003ef\u003c/var\u003e is larger than \u003cvar\u003eci\u003c/var\u003e. Otherwise, he has to keep trying day after day. However, if Cain failed to escape, his fighting capacity would increase \u003cvar\u003eci\u003c/var\u003e as the result of actual combat. (A kindly reminder: Cain will never died.)\n\u003c/p\u003e\n\u003cp\u003e\nAs for \u003cvar\u003eti\u003c/var\u003e, we can easily draw a conclusion that \u003cvar\u003eti\u003c/var\u003e is closely related to \u003cvar\u003eci\u003c/var\u003e. Let\u0027s use the following function to describe their relationship:\n\u003c/p\u003e\n\u003cp\u003e\n\u003c/p\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/42befb60e6900017f3f7a5463ae37491?v\u003d1714376859\"\u003e\u003c/center\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e\nAfter D days, Cain finally escapes from the cave. Please output the expectation of D.\n\u003c/p\u003e\n\n\u003ch4\u003eInput\u003c/h4\u003e\n\n\u003cp\u003e\nThe input consists of several cases.\nIn each case, two positive integers \u003cvar\u003eN\u003c/var\u003e and \u003cvar\u003ef\u003c/var\u003e (\u003cvar\u003en\u003c/var\u003e ≤ 100, \u003cvar\u003ef\u003c/var\u003e ≤ 10000) are given in the first line. The second line includes N positive integers \u003cvar\u003eci\u003c/var\u003e (\u003cvar\u003eci\u003c/var\u003e ≤ 10000, 1 ≤ \u003cvar\u003ei\u003c/var\u003e ≤ N)\n\u003c/p\u003e\n\n\u003ch4\u003eOutput\u003c/h4\u003e\n\n\u003cp\u003e\nFor each case, you should output the expectation(3 digits after the decimal point).\n\u003c/p\u003e\n\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 1\n1 2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6.889\n\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n"}}]}