Given two integers X and Y, the task is to make both the integers equal by performing the following operations any number of times: Increase… Read More

# Tag Archives: GCD-LCM

Given L, B, and H which denotes the length, breadth, and height of a cuboid, the task is to find the minimum number of cuboids… 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 numbers. The task is to find the GCD of the two numbers. Using STL : In Python, the math module contains a number… Read More

Given two integers X and Y, the task is to check if it is possible to reach (X, Y) from (1, 1) by the following… Read More

Given two numbers A and B, the task is to find the minimum number that needs to be added to A and B such that… 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

Given an array arr[] of N positive integers. The task is to find the length of the shortest sub-sequence such that the GCD of the… Read More

Given a number N, the task is to find the largest power of 2 that divides LCM of first N Natural numbers. Examples: Input: N… Read More

Given a number N, the task is to find two numbers a and b such that a + b = N and LCM(a, b) is… Read More

Given an array of string arr[], the task is the Greatest Common Divisor of the given array of string. In strings ‘A’ and ‘B’, we… Read More

Given an integer N (? 2), the task is to find the maximum GCD among all pairs possible by the integers in the range [1,… Read More

Given an integer N, the task is to find the count of all possible pairs of integers (A, B) such that GCD (A, B) +… Read More