# Tag Archives: GCD-LCM

LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. For example, LCM of 15 and 20… Read More
LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. For example, LCM of 15 and 20… Read More
Given an array arr[] of positive integers of size N, the task is to divide the array into two non-empty subsets X and Y in… Read More
Given an integer N, the task is to find two pairs of positive integers such that the GCD of the first pair is the same… Read More
Given two positive integers A and B, the task is to find two positive integers such that they belong in the range [A, B], such… Read More
Given an array arr[] having N integers, the task is to find the GCD of all the numbers in the array which are not prime.… Read More
Given an integer N, the task is to find the value after performing the following N operation when i is 1 initially: Find the value… Read More
Given an array arr[] of integers N, the task is to find the GCD of all numbers for which it’s value is equal to its… Read More
Given an array arr[] of N integers and an integer K, the task is to find the GCD of all the array elements except the… Read More
Given two arrays A[] and B[] of size N and M calculate GCD of all pairwise sum of (A[i]+B[j]) 1<=i<=N and 1<=j<=M. Examples:  Input: A[]… Read More
Given integers L and R, the task is to find the number of integers in range [L, R] (say X) which does not form a… Read More
Given an array A[] and positive integer K, the task is to count the total number of pairs in the array whose product is divisible… Read More
Given a array vec and an integer K, count the number of pairs (i, j) such that vec[i]*vec[j] is divisible by K where i<j. Examples:… Read More
Given, two integers N (always even) and X, the task is to find an array of size N with distinct numbers, such that the sum… Read More
Given a range [L, R] and an integer K, the task is to check if it is possible to make the GCD of all integers… Read More