Avatar ·

Lay out the number for the shortest amount of squares

📁 пример

Task: The user introduces a number no more than 10 000 000 , the program should decompose the number in the amount of the squares so that these squares are the minimum amount

Example: 34 = 25+9

35 = 25+9+1

32+16

39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 39 = 25+9+4+1

honestly, I know Python on 6+, but I will not think the algorithm itself, help at least with it