Contest Duration: - (local time) (100 minutes) Back to Home

Time Limit: 2 sec / Memory Limit: 1024 MB

### 問題文

• 1 \leq a,b,c,d \leq N
• a+b-c-d=K

### 制約

• 1 \leq N \leq 10^5
• -2(N-1) \leq K \leq 2(N-1)
• 入力される数はすべて整数．

### 入力

N K


### 入力例 1

2 1


### 出力例 1

4


• (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)

### 入力例 2

2525 -425


### 出力例 2

10314607400


Score : 400 points

### 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


### Sample Input 1

2 1


### Sample 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)

### Sample Input 2

2525 -425


### Sample Output 2

10314607400