{"raw_statement":[{"iden":"problem statement","content":"Given is a number sequence $A_1, A_2, A_3, \\dots, A_N$, which may contain negative elements.  \nOn a number line, there is a robot at coordinate $0$. It will do the following actions in order:\n\n*   Move $A_1$ in the positive direction.\n*   Move $A_1$ in the positive direction, and then move $A_2$ in the positive direction.\n*   Move $A_1$ in the positive direction, then move $A_2$ in the positive direction, and then move $A_3$ in the positive direction.\n\n$\\hspace{140pt} \\vdots$\n\n*   Move $A_1$ in the positive direction, then move $A_2$ in the positive direction, then move $A_3$ in the positive direction, $\\ldots$, $\\dots$, and then move $A_N$ in the positive direction.\n\nFind the greatest coordinate occupied by the robot from the beginning to the end of the process."},{"iden":"constraints","content":"*   $1 \\le N \\le 200000$\n*   $-10^8 \\le A_i \\le 10^8$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1 \\hspace{7pt} A_2 \\hspace{7pt} A_3 \\hspace{5pt} \\dots \\hspace{5pt} A_N$"},{"iden":"sample input 1","content":"3\n2 -1 -2"},{"iden":"sample output 1","content":"5\n\nThe robot moves as follows:\n\n*   Move $2$ in the positive direction, to coordinate $2$.\n*   Move $2$ in the positive direction, to coordinate $4$. Then move $-1$ in the positive direction, to coordinate $3$.\n*   Move $2$ in the positive direction, to coordinate $5$. Then move $-1$ in the positive direction, to coordinate $4$. Then move $-2$ in the positive direction, to coordinate $2$.\n\nThe greatest coordinate occupied during the process is $5$, so we should print $5$."},{"iden":"sample input 2","content":"5\n-2 1 3 -1 -1"},{"iden":"sample output 2","content":"2"},{"iden":"sample input 3","content":"5\n-1000 -1000 -1000 -1000 -1000"},{"iden":"sample output 3","content":"0\n\nIn this case, the initial coordinate $0$ is the greatest coordinate occupied."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}