If a [ i ] % a [ j ] then update the maximum subsequence length , dp [ i ] = max ( dp [ i ] , 1 + dp [ j ] ) where j is in the range [ 0 , i - 1 ]
dp [ i ] = max ( dp [ i ] , 1 + dp [ j ] ) ; NEW_LINE res = max ( res , dp [ i ] ) ; NEW_LINE