CF629A Far Relative’s Birthday Cake
题目描述
多尔的家人正在庆祝多尔的生日派对。他们爱多尔,所以他们计划让他的生日蛋糕变得不可思议的!
蛋糕是一个由n×n的等边正方形组成的形状,长度为1。每个方块要么是空的,要么是由一个巧克力组成的。他们买了蛋糕,便开始把巧克力放在蛋糕上。“家庭之门”的幸福值等于蛋糕中同一行或同一列中装有巧克力的一对细胞的数量。多尔的家人想知道他们的幸福程度是多少?
输入格式
第一行输入一个整数n(1
输出格式
输出“家庭之门”幸福感的价值,即同一行或同一列的一对巧克力片的数量。
说明/提示
If we number rows from top to bottom and columns from left to right, then, pieces that share the same row in the first sample are:
1. $ (1,2) $ and $ (1,3) $
2. $ (3,1) $ and $ (3,3) $
Pieces that share the same column are: 1. $ (2,1) $ and $ (3,1) $
2. $ (1,3) $ and $ (3,3) $