Fill rest of the elements with 1
for ( $ i = $ P + 1 ; $ i <= $ N ; $ i ++ ) $ arr [ $ i ] = 1 ; echo " The ▁ Minimum ▁ Possible ▁ Sum ▁ is : ▁ " , $ ans , " STRNEWLINE " ; echo " The ▁ Array ▁ Elements ▁ are : ▁ STRNEWLINE " ; for ( $ i = 1 ; $ i <= $ N ; $ i ++ ) echo $ arr [ $ i ] , ' ▁ ' ; }