Function to print the array which contains the unique partitions which are used to form the required sum
function print ( idx ) { for ( var i = 1 ; i < idx ; i ++ ) { document . write ( dp [ i ] + " " ) ; } document . write ( ' ' ) ; }