Tuesday, 13 September 2016

Maximum unique prime factor

Standard
Given q queries with each query containing a number n , your task is to find the maximum number of unique prime factor of a number in the range [1, n] for example:- if n=10 then in the range 1, 2,3,4,5,6,7,8,9,10 6 =2*3 and 10=2*5 has 2 unique prime factors, all other number have either 0 (1 in this case) or 1 ( 2,3,4,5,7,8,9) unique prime factors. so your output will be. 2 if  n=1000 then...

Prime factors

Standard
Given a q queries with each containing a number n , print all the prime factors on n separated by space. for example :- if n=100, print  2 2 5 5 if n=210 print 2 3 5 7 Use this input. 111002109991999387456123378571000000000122232638972687562986844627426988890026890798346736477364738 Post your answer in the comment section. you can use the following compilers to test your code. codepad online...

Unique prime factors

Standard
You are given q queries with each query containing  a number n , your task is to find and print it's total number of unique prime factor . for example:- if n=100 Now 100= 2*2*5*5 so number of unique prime factors of 100 is 2 (i.e. 2 and 5). so your output will look like 100 has 2 unique prime factors : 2 5  if n=420 210=2*2*3*5*7 here number of unique prime factor would be 4...