Given an integer N, the task is to find a sequence of N distinct positive integers such that the Greatest Common Divisor of the sequence… Read More

# Tag Archives: GCD-LCM

Given an array arr[], the task is to check if it is possible to sort the given array using any number of operations where at… Read More

Given an array arr[] of N positive integers, the task is to find the minimum number of operations required to make the GCD of array… Read More

Given an integer array arr[] of N integers, the task is to make each adjacent pair in the array co prime, by adding minimum number of… Read More

Given a Binary Tree consisting of N nodes having no values in it and an integer X, that represents the value of the root node,… Read More

Given an array arr, replace any one element in array with any other integer. The task is to return the maximum number which divides all… Read More

Given an array arr[] consisting of N positive integers and a positive integer X, the task is to find the subset of the given array… Read More

Given an array arr[] consisting of N positive integers, the task is to find the number of pairs such that the Greatest Common Divisor(GCD) of… Read More

Given an integer N, you have to find two proper factors of N such that their sum is coprime with the given integer N. If… Read More

Given an array arr[] consisting of N positive integers, the task is to find all the possible distinct Greatest Common Divisors(GCDs) among all the non-empty… Read More

Given an array A of size N and an integer B, the task is to find all unique quadruplets arranged in the lexicographically increasing order… Read More

Given an integer array arr[] of size N, the task is to calculate the total number of distinct Greatest Common Divisors(GCDs) among all the non-empty… Read More

Given a range L to R, the task is to find the maximum possible value of GCD(X, Y) such that X and Y belongs to… Read More

Given an array A[] containing N positive integers, the task is to find the largest possible number K, such that after replacing all elements by… Read More

Given three integers A, B and C. You can add or subtract A, B, or 0 any number of times to form new values in… Read More