#t303. 平面分割(surface)

平面分割(surface)

Dividing a Plane with Lines

Problem Background

Special for beginners, ^_^

Problem Description

There are n (n≤500)n\ (n \le 500) straight lines in the same plane. It is known that p (p≥2)p\ (p \ge 2) of them intersect at the same point. What is the maximum number of different regions these nn lines can divide the plane into?

Input Format

Two integers n (n≤500)n\ (n \le 500) and p (2≤p≤n)p\ (2 \le p \le n).

Output Format

One positive integer, the maximum number of regions.

Sample Input

12 5

Sample Output

73

Constraints

1 second, 1024 KiB for each test case.