Problem: E
When he was a little boy, Jieba had always been interested in geometry. One time, he got many pieces of colored square cards. For each color, he had as many pieces as he wanted. At that time, he decided to make some cubes using these cards. He wanted to know how many kinds of cubes could he make? (if one kind of cube can rotate to another kind, they will be seen the same)
Every line of the input file defines a test case and contains one integer: the number of available colors n (0<n<1000)
For each test case output on a single line the number of different kinds of cubes. Because the result may be too large, please mod the result with 1000000007.
#include<stdio.h>
#include<iostream>
#define mo 1000000007
using namespace std;
long long get_mod(int a, int b)
{
long long result = 1;
while(b--)
{
result = result * a ;
}
return result;
}
int main()
{
int i;
while(~scanf("%d",&i))
{
int64_t res;
res=((get_mod(i,6)+3*get_mod(i,4)+12*get_mod(i,3)+8*get_mod(i,2))/24)%mo;
printf("%I64d\n",res);
}
return 0;
}
————————————
long long get_mod(int a,int b,int c)
{
long long res=1;
while(b--)
{
res*=a;
res%=c;
}
return res;
}