Prime Factors and their Powers
PROBLEM : Given a number N, print all its unique prime factors and their powers in N. N = 100 Factor Power 2 2 5 2 N = 35 Factor Power 5 1 7 1 Input: The first line of input contains an integer T denoting the number of test cases. The first line of each test case is N. Output: Print all prime factors and their powers separated by spaces. The output should be printed in increasing order of prime factors. Constraints: 1 = T = 200 2 = N = 10000 Example: Input: 2 100 35 Output: 2 2 5 2 5 1 7 1 -------------------------------------------------------------------------------- SIMPLE c++ IMPLEMENTATION : -------------------------------------------------------------------------------- #include<iostream> using namespace std; #include<math.h> void Prime_Factors_Powers(int ) ; void find_prime(int [],int ) ; int main() { ...