Main »
2014 » November » 6 » wood.cpp
|
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<queue>
#include<list>
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
#define mmt(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define y1 fuck
using namespace std;
typedef long long LL;
typedef long double LD;
int n,lim;
LL f(int k)
{
if (lim>k-1) return k-1;
return max(k-1-((k-lim-1)<<1),0);
}
int main()
{
int n,i;
scanf("%d",&n);
lim=n/2-1;
if (n%2==1) lim++;
LL ans=0;
FOR(i,2,n-2)
{
ans+=f(i)*f(n-i);
}
printf("%lld\n",ans);
return 0;
}
|
Views: 273 |
Added by: dhy0077
| Rating: 0.0/0 |