Given the size of a spiral, calcuale the sum of the four corners.
UnsolvedGiven a size for a number spiral, you count clockwise with numbers. A 3x3 is 3 columns by 3 rows.
2x2 3x3 4x4 1 2 7 8 9 7 8 9 10 4 3 6 1 2 6 1 2 11 5 4 3 5 4 3 12 16 15 14 13
The input gives you the size of the spiral that you need to create. The goal is to sum the corners. If you look at the 3x3 grid, the numbers at the corners are 7, 9, 3, and 5. If you sum these, you get 24, which is the answer. Write a program that will provide the sum of the corners for any sized spiral up to 100x100.
value1
Single string formatted as 'numberxnumber'.
Sample Input 1
value1: 3x3 output: 24
Sample Input 2
value1: 4x4 output: 46