407423: GYM102788 A Normal Magic Square

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Normal Magic Squaretime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

A normal magic square of order $$$n$$$ is an $$$n \times n$$$ grid (where $$$n$$$ is the number of cells on each side), filled with distinct positive integers in the range from $$$1$$$ to $$$n^2$$$, so that each cell contains a different integer and the sum of the integers in each row, column, and diagonal (primary and secondary) is equal.

Normal magic squares exist for all orders except $$$2 \times 2$$$ (order $$$n = 2$$$). The $$$1 \times 1$$$ magic square, with only one cell containing the number $$$1$$$, is called trivial. The minimal non-trivial case of order $$$3$$$ is shown below.

You can practice building normal magic squares in your spare time, but now your task is to write a program that returns the sum of numbers in the first line, given the order of the square.

Input

The input file contains one positive integer $$$n$$$ ($$$1 \le n \le 1000, n \ne 2$$$) — the order of the square.

Output

In the output file, write down the sum of the elements on the first line of an $$$n \times n$$$ normal magic square.

ExamplesInput
3
Output
15
Input
1
Output
1

加入题单

算法标签: