{"raw_statement":[{"iden":"statement","content":"You're given a vector with n elements. Piro starts from cell 1. He walks x seconds. In each second, he can move to an adjacent cell: for a cell i with 2 ≤ i ≤ n, he can move to i - 1 and i + 1. From cell 1 he can only move to cell 2 and from cell n he can only move to cell n-1. \n\nInitially, his sum is what's written on cell 1, from where he starts. Next x seconds, his sum increases by what's written on each cell he visits during those x seconds. What's the maximum sum he can get? Formally, given vector A, choose i1, i2, ..., ix such as you maximize the sum A[1] + A[i1] + A[i2] + ... + A[ix], where 1 ≤ ik ≤ n and |ik - ik - 1| = 1.\n\nGiven an array and q queries, each query containing a value x, please answer all of them!\n\nThe first line contains numbers n and q (1 ≤ n, q ≤ 105, n is at least 2). Next n lines contain the values of vector: each element of vector is between 1 and 105. Next q lines contain values of queries: each lines contains a new value for x (1 ≤ x ≤ 109).\n\nOutput q lines, containing the answers for each query. \n\n"},{"iden":"input","content":"The first line contains numbers n and q (1 ≤ n, q ≤ 105, n is at least 2). Next n lines contain the values of vector: each element of vector is between 1 and 105. Next q lines contain values of queries: each lines contains a new value for x (1 ≤ x ≤ 109)."},{"iden":"output","content":"Output q lines, containing the answers for each query. "},{"iden":"examples","content":"Input3 25 2 112Output712"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ A, B, P \\in \\mathbb{Z}^+ $ be given constants, where:  \n- $ A $ and $ B $ are fixed performance coefficients,  \n- $ P $ is the minimum required performance in Performance Points.  \n\nLet $ n \\in \\mathbb{Z}^+ $ denote the number of GPU cores.  \n\nThe performance function is:  \n$$ P(n) = A \\cdot n + B $$  \n\n**Constraints**  \n1. $ 1 \\leq A \\leq 10^5 $  \n2. $ 1 \\leq B \\leq 10^5 $  \n3. $ 1 \\leq P \\leq 10^9 $  \n\n**Objective**  \nFind the minimal integer $ n $ such that:  \n$$ A \\cdot n + B \\geq P $$","simple_statement":"Given A, B, and P, find the smallest integer n such that A * n + B >= P.","has_page_source":false}