{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eFarmer 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.\n\n\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.\n\u003cbr\u003e\n\u003cbr\u003eCalculate the fence placement that maximizes the average, given the constraint. \n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e* Line 1: Two space-separated integers, N and F.\n\u003cbr\u003e\n\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.\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e* 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.\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e10 6\n6 \n4\n2\n10\n3\n8\n5\n9\n4\n1\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e6500\n\u003c/pre\u003e"}}]}