13224: 他们是互补的
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:1
Solved:0
Description
对于两个数对<a, b> 和 <c, d>,如果 a+d 等于 b+c,并且a!=c、b!=d, 那么我们就称<a, b> 和 <c, d>是互补的。
现给你一个整数n (1<= n<= 1000),请问<0, 0>, <0, 1>, <0, 2>, ... , <0, n>, <1, 0 >, ... , <n, n>这些满足<x, y> (0<=x <=n, 0<=y <=n)的数对中,有多少互补的。约定 {<1, 3>, <2,4>} 和 {<2, 4>,<1, 3>}为一种答案。
Input
多组数据。每组数据包含一个整数n,1<= n<= 1000。
Output
对于每组数据输出一行表示答案。
Sample Input Copy
1
2
10
Sample Output Copy
1
5
385
HINT
当n=1的时候,{<0,0>,<1,1>};
当n=2的时候,{<0,0>,<1,1>},{<1,1>,<2,2>},{<0,0>,<2,2>},{<1,0>,<2,1>},{<0,1>,<2,1>};