Distribute the number among k elements
temp = Sk / k ; NEW_LINE rem = Sk % k ; NEW_LINE if ( temp + rem >= l and temp + rem <= r ) : NEW_LINE INDENT a [ i ] = temp ; NEW_LINE DEDENT elif ( temp + rem > r ) : NEW_LINE INDENT a [ i ] = r ; NEW_LINE DEDENT elif ( temp + rem < r ) : NEW_LINE INDENT print ( " - 1" ) ; NEW_LINE return ; NEW_LINE DEDENT Sk = Sk - a [ i ] ; NEW_LINE k = k - 1 ; NEW_LINE