#include <stdio.h>
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int a[2050];
int main(){
int n,s;
while(scanf("%d",&n)!=EOF)
{
s=n*n*n*(n*n*n-1)/2-3*n*n*(n-1);
printf("%d\n",s);
}
return 0;
}
把立方体切成单位体,然后算出0公共点和2公共点的两个立方体数目,只要算出总数3N*(3N-1)/2再减去4个公共点的个数3N*N*(N-1)就好。
只不过我第一次输入的时候没加EOF,直接OLT了,悲剧