Skip to content

Tag Archives: GCD-LCM

Given an array arr[] and two integers X and Y. The task is to check whether it is possible to make all the elements equal… Read More
Given two integers N and K, the task is to find the count of quadruples of (i, j, k, l) such that 1 ≤ i… Read More
Given an array arr[] of length N ≥ 2. The task is to remove an element from the given array such that the GCD of… Read More
Given an array arr[] of N integers, the task is to find the minimum deletions required to make the GCD of the resulting array elements… Read More
Given two arrays such that the first array contains multiples of an integer n which are less than or equal to k and similarly, the… Read More
Given a matrix mat[][] of size N * N, the task is to find the sum of GCDs of all the rows of the given… Read More
Given an integer K and a range [L, R], the task is to count the quadruplet pairs from the given range having gcd equal to… Read More
Given an N-ary tree and an array val[] which stores the values associated with all the nodes. Also given are a leaf node X and… Read More
Given two integer N and K, the task is to find the permutation P of first N natural numbers such that there are exactly K… Read More
Given an array arr[] of N integers and queries Q. Queries are of two types:  Update a given index ind by X. Find the gcd… Read More
Given N monsters, each monster has initial health h[i] which is an integer. A monster is alive if its health is greater than 0. In… Read More
Given two integer x and y, the task is to find the HCF of the numbers without using recursion or Euclidean method. Examples:  Input: x… Read More
Given two integers x and y and where x is divisible by y. It can be represented in the form of a fraction x/y. The… Read More
Given an array arr[] containing GCD of every possible pair of elements of another array. The task is to find the original numbers which are… Read More
Given five integers N, A, B, X and Y. The task is to find the maximum profit obtained from the numbers from the range [1,… Read More

Start Your Coding Journey Now!