atcoder#WTF19D. Distinct Boxes
Distinct Boxes
Score : points
Problem Statement
Snuke has red balls and blue balls. He distributes them into boxes, so that no box is empty and no two boxes are identical. Compute the maximum possible value of .
Formally speaking, let's number the boxes through . If Box contains red balls and blue balls, the following conditions must be satisfied:
- For each (), or .
- For each (), or .
- and (no balls can be left outside the boxes).
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible value of .
8 3
5
The following picture shows one possible way to achieve :