No.1089 Three-Variable Equation
タグ : / 解いたユーザー数 193
作問者 :
null
/ テスター :
butsurizuki
Problem Statement
Find the number of triples $(x,y,z)$ of non-negative integers (integers at least $0$) satisfying $x+y+z=N$.
Input
$N$
$0 \le N \le 3 \times 10^3$
All inputs are integers.
Output
Output the answer on one line, followed by a newline.
Sample
Sample 1
Input
2
Output
6
There are $6$ triples: $(2,0,0), (0,2,0), (0,0,2), (1,1,0), (0,1,1), (1,0,1)$.
Sample 2
Input
10
Output
66
Source
YSF Beginner Contest: B - Three-Variable Equation
writer: null
tester: butsuri_0523
Ported in accordance with HackerRank's terms. Some parts have been modified due to site-specific circumstances and other reasons.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。