Company: hire.glider.ai
Difficulty: medium
Buy Concert Tickets 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 the n -th day is calculated by the following equation: Cost = k n × T 2 — where k is a given constant, n (initially n = 0 ) is the number of days that have passed, and T is the number of tickets Louie buys on the n -th day. Day numbering starts from 0 . Louie may spread his purchases across as many days as he likes, buying zero or more tickets on each day. You are given two integers — m , the total number of tickets Louie wants to buy, and k , the constant for the equation. Help Louie determine the minimum total cost of purchasing exactly m tickets. Input The first line contains an integer m — the total number of tickets Louie wants to buy. The second line contains an integer k — the constant for the equation. Output Print a single integer — the minimum total cost of purchasing m tickets. Constraints