{"raw_statement":[{"iden":"statement","content":"You just went on a very hilly bike ride, and you want to find largest hill that you biked up during your ride.\n\nYou know the elevations of several points along your ride, and you want to find the vertical rise of the largest continously uphill section of the ride. A continuously uphill section must have a positive overall vertical rise, and must consist of only uphill segments. If a section of the ride has any downhill or flat subsections, it is not considered a continuously uphill section.\n\nThe first line of input contains a single positive integer $n$: the number of points along the ride that you know the elevations for.\n\nThe next line contains $n$ space-separated integers: the elevation, along each point of the ride.\n\nOutput a single positive integer $v$: the value of the biggest hill on the ride, defined as the vertical rise of the largest continiously uphill section, as defined above. There is guaranteed to be at least one continously uphill section in the route given in the input.\n\n"},{"iden":"input","content":"The first line of input contains a single positive integer $n$: the number of points along the ride that you know the elevations for.The next line contains $n$ space-separated integers: the elevation, along each point of the ride."},{"iden":"output","content":"Output a single positive integer $v$: the value of the biggest hill on the ride, defined as the vertical rise of the largest continiously uphill section, as defined above. There is guaranteed to be at least one continously uphill section in the route given in the input."},{"iden":"examples","content":"Input7\n600 650 700 690 740 520 600\nOutput100\nInput5\n400 500 600 700 400\nOutput300\nInput8\n100 200 300 300 400 500 600 700\nOutput400\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of elevation points.  \nLet $ E = (e_1, e_2, \\dots, e_n) $ be a sequence of integers representing elevations at consecutive points along the ride.\n\n**Constraints**  \n1. $ n \\geq 2 $  \n2. $ e_i \\in \\mathbb{Z} $ for all $ i \\in \\{1, \\dots, n\\} $  \n3. There exists at least one continuously uphill section.\n\n**Objective**  \nFind the maximum vertical rise over any contiguous subsequence $ (e_i, e_{i+1}, \\dots, e_j) $ where $ 1 \\leq i < j \\leq n $ and $ e_k < e_{k+1} $ for all $ k \\in \\{i, i+1, \\dots, j-1\\} $.  \nThat is, compute:  \n$$\n\\max_{\\substack{1 \\leq i < j \\leq n \\\\ e_k < e_{k+1} \\, \\forall k \\in [i,j-1]}} (e_j - e_i)\n$$","simple_statement":"Find the largest vertical rise in any continuously uphill section of a bike ride, where uphill means strictly increasing elevation between consecutive points.","has_page_source":false}