410540: GYM104048 A Copper Corners
Description
You are manufacturing sheets of copper for the Copper Corporation. Each sheet is broken up into individual units that form a square. The value that a sheet of copper will sell for is the sum of the copper amounts of the units in the top left corner, top right corner, bottom left corner, and bottom right corner. If the entire sheet is only made up of one unit, then the value of the sheet is simply the value of the one unit.
InputThe first line of input will contain a single integer $$$s$$$ ($$$1 \leq s \leq 50$$$), representing the number of units in a single row of the copper square. The next $$$s$$$ lines will each contain $$$s$$$ space separated positive integers, representing copper amounts in all the units that form the square. Every unit has a copper amounts of at most $$$1000$$$.
OutputOutput the value of the given sheet of copper.
ExamplesInput1 7Output
7Input
3 1 3 4 3 1 4 5 7 2Output
12