{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Farmer John\u0027s farm consists of a long row of N (1 \u0026lt;\u003d N \u0026lt;\u003d 100,000)fields. Each field contains a certain number of cows, 1 \u0026lt;\u003d ncows \u0026lt;\u003d 2000.\r\u003cbr\u003e\r\u003cbr\u003eFJ wants to build a fence around a contiguous group of these fields in order to maximize the average number of cows per field within that block. The block must contain at least F (1 \u0026lt;\u003d F \u0026lt;\u003d N) fields, where F given as input.\r\u003cbr\u003e\r\u003cbr\u003eCalculate the fence placement that maximizes the average, given the constraint. \r\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"* Line 1: Two space-separated integers, N and F.\r\u003cbr\u003e\r\u003cbr\u003e* Lines 2..N+1: Each line contains a single integer, the number of cows in a field. Line 2 gives the number of cows in field 1,line 3 gives the number in field 2, and so on.\r\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"* Line 1: A single integer that is 1000 times the maximal average.Do not perform rounding, just print the integer that is 1000*ncows/nfields.\r\u003cbr\u003e"}},{"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\u003e10 6\r\n6 \r\n4\r\n2\r\n10\r\n3\r\n8\r\n5\r\n9\r\n4\r\n1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6500\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}