2011年12月17日 星期六

11296 - Counting Solutions to an Integral Equation

Problem

給定 n 之值,請你計算等式:x + 2y + 2z = n 共有幾組解,其中x, y, z, n為非負整數。

The Input

最多有1500組測試資料,每組資料一列有一個整數 n (n < 1000001)。

The Output

請輸出每組測試資料的解。

Sample Input

2
3

Sample Output

3
3


原文出處

沒有留言:

張貼留言