#C9684. Arithmetic Sequences Count

    ID: 53804 Type: Default 1000ms 256MiB

Arithmetic Sequences Count

Arithmetic Sequences Count

You are given two positive integers n and k. Your task is to compute the number of distinct arithmetic sequences of length n that can be formed using the integers from 1 to k under a special rule. In this problem the answer turns out to be determined solely by k regardless of n (when n ≥ 1). In particular, the answer is given by the formula:

$\displaystyle \frac{k(k+1)}{2}$

For example, when n=2 and k=3, the answer is 6. Similarly, when n=3 and k=4, the answer is 10.

inputFormat

The input consists of a single line with two space-separated integers: n and k.

outputFormat

Output a single integer, which is the number of distinct arithmetic sequences computed by the formula k(k+1)2\frac{k(k+1)}{2}.## sample

2 3
6