Stores the frequencies of prime divisors
HashMap < Integer , Integer > prime = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( prime . containsKey ( p [ i ] ) ) prime . put ( p [ i ] , prime . get ( p [ i ] ) + 1 ) ; else prime . put ( p [ i ] , 1 ) ; } int product = 1 , d = 1 ;