# Tag Archives: GCD-LCM

Given an array arr[] of 2 * N integers, the task is to find a set of N – 1 pairs such that the GCD… Read More
Given three positive integers X, Y, and Z. The task is to find two numbers A and B of X and Y digits respectively with… Read More
Given three integers L, R, and K. Consider an array arr[] consisting of all the elements from L to R, the task is to check… Read More
Given an array arr[] of N positive integers, the task is to find the smallest possible value of the last remaining element in the array… Read More
Given an array arr[] of size N. The task is to reorder arr[] and find the maximum number of GCD pairs which follows the conditions… Read More
Given an array arr[] of positive numbers. The task is to check if there exists any subset of any size such that after multiplying each… Read More
Given an array arr[] containing N positive integers, the task is to find the total number of elements in the array that are divisible by… Read More
Given a positive integer, A. The task is to find two numbers B and C such that their product is A and their GCD should… Read More
Given an array arr[] of N integers and Q queries of the form (l, r). The task is to find the number of distinct pairs… Read More
Given an array arr[] containing N positive integers and two variables L and R indicating a range of integers from L to R (inclusive). The… Read More
Given an array arr[] of N integers, the task is to find an integer X such that the integers that are divisible by X and… Read More
Given a positive integer N, the task is to find a triple of three distinct positive integers (X, Y, Z) such that X + Y… Read More
Given an array arr[] of size n, The task is to find the GCD of the highest and lowest frequency element in the given array.… Read More
Given two integers P and Q, the task is to find any two integers whose Greatest Common Divisor(GCD) is P and the difference between their… Read More
Given an Integer as N, the task is to convert N into two numbers a and b, such that a < b and GCD(a, b)… Read More