AtCoder Regular Contest 107
翻译中…
Problem Statement
翻译中…
Given are integers $N$ and $K$. How many quadruples of integers $(a,b,c,d)$ satisfy both of the following conditions?
翻译中…
$1 \leq a,b,c,d \leq N$$a+b-c-d=K$
翻译中…
Constraints
翻译中…
$1 \leq N \leq 10^5$$-2(N-1) \leq K \leq 2(N-1)$- All numbers in input are integers.
翻译中…
Input
翻译中…
Input is given from standard input in the following format:
翻译中…
N K
翻译中…
Output
翻译中…
Print the answer.
翻译中…
样例
Input #1
2 1
Output #1
4
Four quadruples below satisfy the conditions:
- $(a,b,c,d)=(2,1,1,1)$
- $(a,b,c,d)=(1,2,1,1)$
- $(a,b,c,d)=(2,2,2,1)$
- $(a,b,c,d)=(2,2,1,2)$
Input #2
2525 -425
Output #2
10314607400
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。