Company: Intuit_8feb
Difficulty: medium
Buy Concert Tickets - II Problem Description Louie wants to buy m tickets for the upcoming concert of a favorite rock band. Each day ticket prices change. The cost of buying T tickets on an n th day is calculated by the following equation: Cost = k * n * T^2 - where k is some constant, n (initially n = 0 ) - number of days that have passed, and T is the number of tickets Louie will buy on an n th day. Day numbering starts from 0. You are given two integers m - the total amount of tickets Louie wants to buy and k - constant for the equation. Help Louie determine the minimum cost of purchasing m tickets. Input The first line of input contains an integer m , representing the total amount of tickets Louie wants to buy. The second line of input contains an integer k , representing the constant for the equation. Output Print the minimum cost of purchasing m tickets. Constraints 0 ≤ m ≤ 10 6 1 ≤ k ≤ 10 4 Examples Example 1: Input: 6 2 Output: 21 Explanation: The optimal solution i