Given an array arr[] consisting of N positive integers, the task is to find the sum of factors of product of all array elements. Since… Read More

# Tag Archives: prime-factor

Given an integer N, the task is to print prime factors of N in decreasing order using the stack data structure. Examples: Input: N =… Read More

Given an array arr[] of size N, the task is to find the winner of the game when two players play the game optimally as… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to count the number of array elements having exactly K… Read More

Given two positive integers K and X, the task is to find the minimum possible sum of K positive integers ( repetitions allowed ) having… Read More

Given two positive integers P and Q, the task is to largest divisor of P which is not divisible by Q. Examples: Input: P =… Read More

Given an array arr[] of size N, the task is to count the number of pairs from the given array whose product contains only a… Read More

Given an integer N, the task is to reduce N to 1 by minimum number of operations involving multiplication by 2 and division by 10.… Read More

Given a 2D array Q[][] of size N * 2 representing queries of the form {L, R}. For each query, the task is to print… Read More

Given an integer N, the task is to find the number of ways N! can be split into two distinct factors A and B such… Read More

Given an integer N, the task is to count the total number of ordered pairs such that the LCM of each pair is equal to… Read More

Given an integer N, the task is to find the sum of all numbers in the range [1, N] that are co-prime with the given… Read More

Given an integer N, the task is to find the product of all the numbers from the range [1, N] that are co-prime to the… Read More

Given an array A[] consisting of N positive integers, the task is to check if all the array elements are pairwise co-prime, i.e. for all… Read More