Take the maximum count of prime in a number
else { foreach ( KeyValuePair < long , long > ele in single_number ) { if ( prime_factor . ContainsKey ( ele . Key ) ) { prime_factor [ ele . Key ] = Math . Max ( ele . Value , prime_factor [ ele . Key ] ) ; } else { prime_factor [ ele . Key ] = Math . Max ( ele . Value , 0 ) ; } } } } long ans = 0 , lcm = 1 ;