#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
ll n, m;
while(cin >> n && n > 0)
{
m = (n*(n+1)*(2*n+1))/6;
cout << m << endl;
}
return 0;
}
#define ll unsigned long long int
using namespace std;
int main()
{
ll n, m;
while(cin >> n && n > 0)
{
m = (n*(n+1)*(2*n+1))/6;
cout << m << endl;
}
return 0;
}
Comments
Post a Comment