Fill rest of the elements with 1
for ( int i = P + 1 ; i <= N ; i ++ ) { arr [ i ] = 1 ; } Console . Write ( " The ▁ Minimum ▁ Possible ▁ Sum ▁ is : ▁ " + ans + " STRNEWLINE " ) ; Console . Write ( " The ▁ Array ▁ Elements ▁ are : ▁ STRNEWLINE " ) ; for ( int i = 1 ; i <= N ; i ++ ) { Console . Write ( arr [ i ] + " ▁ " ) ; } }