{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cimg src\u003d\"CDN_BASE_URL/7fe7f3a516a37fdb3b8e46be0b8c6a17?v\u003d1715636230\" align\u003d\"right\"\u003eThe New Year garland consists of N lamps attached to a common wire that hangs down on the ends to which outermost lamps are affixed. The wire sags under the weight of lamp in a particular way: each lamp is hanging at the height that is 1 millimeter lower than the average height of the two adjacent lamps.\r\u003cbr\u003e\r\u003cbr\u003eThe leftmost lamp in hanging at the height of A millimeters above the ground. You have to determine the lowest height B of the rightmost lamp so that no lamp in the garland lies on the ground though some of them may touch the ground.\r\u003cbr\u003e\r\u003cbr\u003eYou shall neglect the lamp\u0027s size in this problem. By numbering the lamps with integers from 1 to N and denoting the ith lamp height in millimeters as Hi we derive the following equations:\r\u003cbr\u003e\r\u003cbr\u003eH1 \u003d A \r\u003cbr\u003eHi \u003d (H\u003csub\u003ei-1\u003c/sub\u003e + H\u003csub\u003ei+1\u003c/sub\u003e)/2 - 1, for all 1 \u0026lt; i \u0026lt; N \r\u003cbr\u003eHN \u003d B \r\u003cbr\u003eHi \u0026gt;\u003d 0, for all 1 \u0026lt;\u003d i \u0026lt;\u003d N \r\u003cbr\u003e\r\u003cbr\u003eThe sample garland with 8 lamps that is shown on the picture has A \u003d 15 and B \u003d 9.75.\r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input file consists of a single line with two numbers N and A separated by a space. N (3 \u0026lt;\u003d N \u0026lt;\u003d 1000) is an integer representing the number of lamps in the garland, A (10 \u0026lt;\u003d A \u0026lt;\u003d 1000) is a real number representing the height of the leftmost lamp above the ground in millimeters."}},{"title":"Output","value":{"format":"HTML","content":"Write to the output file the single real number B accurate to two digits to the right of the decimal point representing the lowest possible height of the rightmost lamp."}},{"title":"Sample","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\u003e692 532.81\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e446113.34\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}