CF367C Sereja and the Arrangement of Numbers
Description
Let's call an array consisting of $ n $ integer numbers $ a_{1} $ , $ a_{2} $ , $ ... $ , $ a_{n} $ , beautiful if it has the following property:
- consider all pairs of numbers $ x,y $ $ (x≠y) $ , such that number $ x $ occurs in the array $ a $ and number $ y $ occurs in the array $ a $ ;
- for each pair $ x,y $ must exist some position $ j $ $ (1
Input Format
The first line contains two integers $ n $ and $ m $ $ (1
Output Format
In a single line print maximum amount of money (in rubles) Sereja can pay.
Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
Explanation/Hint
In the first sample Sereja can pay $ 5 $ rubles, for example, if Dima constructs the following array: $ [1,2,1,2,2] $ . There are another optimal arrays for this test.
In the third sample Sereja can pay $ 100 $ rubles, if Dima constructs the following array: $ [2] $ .