text: Single state dynamic programming relation for storing LCM of first i elements from the left in Prefix [ i ]
code: Prefix [ 1 ] = a [ 0 ] ; for ( int i = 2 ; i <= n ; i += 1 ) { Prefix [ i ] = lcm ( Prefix [ i - 1 ] , a [ i - 1 ] ) ; }