Description
给出一个如下图规则的图形,问
a
层的时候所需小球数量
Input
一个整数
Output
输出 a 层所需小球数量
Sample Input
2
Sample Output
13
Solution
简单题,找找规律知答案为
Code
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<ctime>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const int INF=0x3f3f3f3f,maxn=100001;
int main()
{
int n;
while(~scanf("%d",&n))printf("%d\n",6*n*(n-1)+1);
return 0;
}