{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003eYour friend Ómar’s favourite video game is\n \u003cem\u003eStriker-Count\u003c/em\u003e. But he has now grown tired of actually\n playing the game and is more interested in the lootboxes found\n in the game. Inside each lootbox there is an item of some level\n of rarity. Ómar is only interested in acquiring the rarest\n items in the game. When he starts the game, he chooses two\n numbers \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e, such that\n \u003cspan class\u003d\"tex2jax_process\"\u003e$k \\leq n$\u003c/span\u003e. He then opens\n lootboxes in the game until \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e of the last \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e lootboxes included an item of the\n highest rarity.\u003c/p\u003e\n \u003cp\u003eThis activity amuses Ómar, but does not interest you in the\n slightest. You are more interested in the numbers: you know\n that each lootbox Ómar opens has probability \u003cspan class\u003d\"tex2jax_process\"\u003e$p$\u003c/span\u003e of containing an item of highest\n rarity, independently for each lootbox. You want to find the\n expected number of lootboxes Ómar will open before concluding\n his process.\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eThe only line of the input contains the two integers\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$k$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1\n \\le k \\le n \\le 6$\u003c/span\u003e), and the real number \u003cspan class\u003d\"tex2jax_process\"\u003e$p$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0\n \u0026lt; p \\le 1$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$p$\u003c/span\u003e has at most four decimals after\n the decimal point), with meanings as described above.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eOutput the expected number of lootboxes Ómar must open, with\n a relative error of at most \u003cspan class\u003d\"tex2jax_process\"\u003e$10^{-6}$\u003c/span\u003e. It is guaranteed that the\n input is such that this expected number does not exceed\n \u003cspan class\u003d\"tex2jax_process\"\u003e$10^9$\u003c/span\u003e.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\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 2 0.0026\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e74445.39143490087\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\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\u003e6 1 0.0026\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e384.61538461538464\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}