Skip to content

Tag Archives: GCD-LCM

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
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

Start Your Coding Journey Now!