#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
ll a[1000005], b[1000005];
void tri()
{
a[3] = b[3] = 0;
ll i, j, c = 0;
for(i=4;i<=1000000;i++)
{
if(i%2 == 0)
{
c++;
a[i] = a[i-1] + c;
b[i] = b[i-1] + a[i];
}
else
{
a[i] = a[i-1] + c;
b[i] = b[i-1] + a[i];
}
}
}
int main()
{
ll n;
tri();
while(cin >> n && n >= 3)
{
cout << b[n] << endl;
}
return 0;
}
#define ll unsigned long long int
using namespace std;
ll a[1000005], b[1000005];
void tri()
{
a[3] = b[3] = 0;
ll i, j, c = 0;
for(i=4;i<=1000000;i++)
{
if(i%2 == 0)
{
c++;
a[i] = a[i-1] + c;
b[i] = b[i-1] + a[i];
}
else
{
a[i] = a[i-1] + c;
b[i] = b[i-1] + a[i];
}
}
}
int main()
{
ll n;
tri();
while(cin >> n && n >= 3)
{
cout << b[n] << endl;
}
return 0;
}
Comments
Post a Comment