#atcoderABC051B. Sum of Three Integers
Sum of Three Integers
Problem
You are given two integers and .
Three variable and takes integer values satisfying .
How many different assignments of values to and are there such that ?
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the number of the triples of and that satisfy the condition.
Example : 1. in
2 2
Example : 1. out
6
There are six triples of and that satisfy the condition:
Example : 2. in
5 15
Example : 2. out
1
The maximum value of is , achieved by one triple of and .
相关
在下列比赛中: