{"raw_statement":[{"iden":"statement","content":"It's a new year, and there are still firecrackers every now and then. With those loud sounds as cover, you decided to use this time to test your new spy equipment!\n\nEven spies have New Year's Resolutions. In the past year, you've spent a decent amount of your downtime playing Bomberman. Well, this year you've decided to increase your skill in handling actual explosives—not for games, but for professional use only!\n\nAnd so we look at the explosives that you have, which you got from the Armory of Clingy Molotovs.\n\nYou have $n$ explosives, and you arrange them in a line. As they are clingy, they have to be with their fellow molotovs in order to detonate. Specifically, a clingy molotov will detonate and explode if and only if there is at least one clingy molotov to its left, and at least one clingy molotov to its right.\n\nEach molotov has an Explosion Rating $E_i$, which is proportional to the amount of damage that it can cause. Now, what is the total Explosion Rating of all the clingy molotovs that will explode?\n\nThe input starts with a line containing an integer $n$, the number of explosives. The second line contains $n$ integers, $E_1, E_2, \\\\dots, E_n$, denoting the explosion rating of each of the clingy molotoves from left to right.\n\n*Constraints*\n\n$1 <= n <= 100$\n\n$0 <= E_i <= 1000$\n\nOutput, in a single line, a single integer denoting the total Explosion Rating of all the clingy molotovs that will explode.\n\n"},{"iden":"input","content":"The input starts with a line containing an integer $n$, the number of explosives. The second line contains $n$ integers, $E_1, E_2, \\\\dots, E_n$, denoting the explosion rating of each of the clingy molotoves from left to right.*Constraints*$1 <= n <= 100$$0 <= E_i <= 1000$"},{"iden":"output","content":"Output, in a single line, a single integer denoting the total Explosion Rating of all the clingy molotovs that will explode."},{"iden":"examples","content":"Input6\n1 3 5 2 3 10\nOutput13\nInput2\n5 10\nOutput0\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ a \\in \\mathbb{Z} $ denote the age of the person.  \nLet $ r \\in \\{ \\text{“Intern”}, \\text{“Junior”}, \\text{“Senior”}, \\text{“Manager”}, \\text{“VP”} \\} $ denote the ranking of the person.  \nLet $ t $ denote the title of the resource being accessed.\n\n**Constraints**  \n1. $ 0 \\leq a \\leq 150 $  \n2. $ r $ is one of: “Intern”, “Junior”, “Senior”, “Manager”, “VP”  \n3. $ t $ is a non-empty string (title of resource)\n\n**Objective**  \nGrant access if and only if:  \n- $ a \\geq 18 $ and $ r = \\text{“Manager”} $, or  \n- $ a \\geq 18 $ and $ r = \\text{“VP”} $, or  \n- $ a \\geq 25 $ and $ r = \\text{“Senior”} $, or  \n- $ a \\geq 21 $ and $ r = \\text{“Junior”} $, or  \n- $ a \\geq 18 $ and $ r = \\text{“Intern”} $  \n\nOutput “GRANT” if access is granted, otherwise output “DENY”.","simple_statement":"Grant access if the person is 18 or older and their ranking matches the required level for the title. Otherwise, deny access.","has_page_source":false}