Easy Equation
时间限制:C/C++ 2秒,其他语言4秒
空间限制:C/C++ 524288K,其他语言1048576K
64bit IO Format: %lld
题目描述
You are given four positive integers 𝑥, 𝑦, 𝑧, 𝑘, please help little M calculate the number of equations 𝑥 + 𝑦 + 𝑧 = 𝑘 when 0 ≤ 𝑥 ≤ 𝑎, 0 ≤ 𝑦 ≤ 𝑏, 0 ≤ 𝑧 ≤ 𝑐, 0 ≤ 𝑘 ≤ 𝑑
输入描述:
Four integers 𝑎, 𝑏, 𝑐, 𝑑 (0 ≤ 𝑎, 𝑏, 𝑐, 𝑑 ≤10^610
6
)
输出描述:
One integer the number of equations.
It is guaranteed that all the answers fit 64-bit integer.
示例1
输入
3 3 3 3
输出
20
示例2
输入
300 300 300 300
输出
4590551
示例3
输入
0 0 0 0
输出
1
示例4
输入
12345 12345 12345 12345
输出
313713415596
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int <