i will begin from maxVal which is the maximum value which can be used to form the sum
i = maxVal NEW_LINE while ( i >= 1 ) : NEW_LINE INDENT if ( i > remSum ) : NEW_LINE INDENT i -= 1 NEW_LINE continue NEW_LINE DEDENT elif ( i <= remSum ) : NEW_LINE DEDENT