#B4410. [GESP202509 一级] 金字塔

[GESP202509 一级] 金字塔

Cannot parse: bad indentation of a mapping entry (3:10) 1 | time: 1s 2 | memory: 131072 3 | - input: 1.in --------------^ 4 | output: 1.out 5 | - input: 2.in

题目背景

对应的选择、判断题:https://ti.luogu.com.cn/problemset/1189

题目描述

金字塔由 nn 层石块垒成。从塔底向上,每层依次需要 $n \times n, (n-1) \times (n-1), \cdots, 2 \times 2, 1 \times 1$ 块石块。请问搭建金字塔总共需要多少块石块?

输入格式

一行,一个正整数 nn,表示金字塔的层数。

输出格式

一行,一个正整数,表示搭建金字塔所需的石块数量。

输入输出样例 #1

输入 #1

2

输出 #1

5

输入输出样例 #2

输入 #2

5

输出 #2

55

说明/提示

对于所有测试点,保证 1≤n≤501 \leq n \leq 50。