Minimum number of perfect squares
Given an integer
n, you are asked to find as few perfect squares (1, 4, 9, 16, 25, 36, etc.) as possible that sum up to
n. How many perfect squares would you pick?
The input contains a single integer
n(1 ≤ n ≤ 60000).
The program should print the minimum number of perfect squares you would pick.
Time limit: 4.5 seconds
Memory limit: 512 MB
Output limit: 1 MB