Function to print the modified array
def printArray ( A , D ) : NEW_LINE INDENT for i in range ( N ) : NEW_LINE INDENT for j in range ( M ) : NEW_LINE INDENT if ( j == 0 ) : NEW_LINE INDENT A [ i ] [ j ] = D [ i ] [ j ] ; NEW_LINE DEDENT else : NEW_LINE INDENT A [ i ] [ j ] = D [ i ] [ j ] + A [ i ] [ j - 1 ] ; NEW_LINE DEDENT print ( A [ i ] [ j ] , end = ' ▁ ' ) NEW_LINE DEDENT print ( ) NEW_LINE DEDENT DEDENT