{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eRecently your town has been infested by swindlers who convince unknowing tourists to play a simple dice game with them for money. The game works as follows: given is an n-sided die,whose sides have 1, 2, . . . , n pips, and a positive integer k. You then roll the die, and then have to make a choice. Option 1 is to stop rolling. Option 2 is to reroll the die, with the limitation that the die can only be rolled k times in total. Your score is the number of pips showing on your final roll.\u003c/p\u003e\n\u003cp\u003eObviously the swindlers are better at this game than the tourists are. You, proud supporter of the Battle Against ProbabilisticCatastrophes, decide to fight this problem not by banning the swindlers but by arming the tourists with information.\u003c/p\u003e\n\u003cp\u003eYou create pamphlets on which tourists can find the maximum expected score for many values of n and k. \u003cb\u003eYou are sure that the swindlers will soon stop their swindling if the tourists are better prepared than they are!\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003eThe layout of the flyers is done, and you have distribution channels set up. All that is left to do is to calculate the numbers to put on the pamphlet.\u003c/p\u003e\n\u003cp\u003eGiven the number of sides of the die and the number of times you are allowed to roll, calculate the expected (that is, average) score when the game is played optimally.\u003c/p\u003e\n\u003cp\u003e\u003cimg alt\u003d\"image.jpg\" src\u003d\"CDN_BASE_URL/2246e9ac7a0610766b6ece8d07999b0a?v\u003d1666408931\" width\u003d\"600\" height\u003d\"600\"\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eINPUT:\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e• A single line with two integers 1 ≤ n ≤ 100, the number of sides of the die, and 1 ≤ k ≤ 100, the number of times the die may be rolled.\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eOUTPUT:\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003eOutput the expected score when playing optimally. Your answer should have an absolute or relative error of at most 10^-7.\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eSample Input 4:\u003c/b\u003e\u003c/p\u003e\n\u003cp\u003e8\u0026nbsp; 9\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003cb\u003eSample Output 4:\u003c/b\u003e\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003e7.268955230712891\u003cbr\u003e\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e1 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e2 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1.875\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4.25\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}