ACM UVA-11401

dp

typedef unsigned long long ull;
ull ans[1000001];
ull f[1000001];
int main(int argc, char const* argv[])
{
    int n;
    f[3] = 0;
    ans[3] = 0;
    f[4] = 1;
    ans[4] = 1;
    for(int i = 5;i <= 1000000;i++){
        f[i] = f[i-1]+((i/2)-1);
        ans[i] = ans[i-1]+f[i];
    }
    while(~scanf("%d",&n) && n >= 3){
        printf("%llu\n",ans[n]);

    }

    return 0;
}