Consider N positive integers which are not necessarily distinct such that their sum of cubes is equal to 2011 (base ten) and their sum of squares is a perfect square.

Determine the smallest value of N for which this is possible. What is the next smallest value of N?