Shubham just got placed in a Nutrition company and his job is to label all the best power foods in the market. Every food item arranged in a single line, will have a value beginning from 1 and increasing by 1 for each, until all items have a value associated with them. An item’s value is the same as the number of macronutrients it has.
For example, food item with value 1 has 1 macronutrients, food item with value 2 has 2 macronutrients, and incrementing in the fashion.
Shubham has to recommend the best combination to patients, i.e maximum total of macronutrients. However, he must avoid prescribing a particular sum of macronutrients (an ‘unhealthy’ number) and this sum is known. The nutritionist chooses food items in the increasing oder of their value. Compute the highest total of macronutrients that can be prescribed to a patient without the sum matching the given ‘unhealthy’ number.
Here’s an illustration:
Given 4 food items [hence value: 1,2,3,4] and the unhealthy sum being 6 macronutrients, on choosing 1,2,3 -> the sum is 6, which matches the ‘unhealthy’ sum. Hence, one of the three needs to be skipped. Thus, the best combination is from among:
Since 2 + 3 + 4 = 9, allows for maximum number of macronutrients , 9 is the right answer.
Constraints:
1 <= n <= 2*109
1 <= k <= 109
Input format:
First line contain an integer n that denotes the number of food items.
Next line contain an integer k that denotes the unhealthy number.
Output format:
Print an integer that represent the maximum total of macronutrients.
Input 0:
2
2
Output 0:
3
Explanation:
The following sequence of n=2 food items:
Input 1:
2
1
Output 1:
2
Explanation:
Input 2:
3
3
Output 2:
5
Explanation:
2 + 3 = 5 is the best case for maximum nutrients.