## Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + … is maximized

Given an array a of size N. The task is to find a subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3])… Read More »

- Count common elements in two arrays containing multiples of N and M
- Find original numbers from gcd() every pair
- Minimum deletions required to make GCD of the array equal to 1
- Count of quadruplets from range [L, R] having GCD equal to K
- Find permutation of first N natural numbers that satisfies the given condition
- Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized
- Queries to update a given index and find gcd in range
- Minimum LCM and GCD possible among all possible sub-arrays
- Remove an element to maximize the GCD of the given array
- Reduce the fraction to its lowest form
- Find GCD of factorial of elements of given array
- Smallest integer > 1 which divides every element of the given array
- Find HCF of two numbers without using recursion or Euclidean algorithm
- Count numbers in range 1 to N which are divisible by X but not by Y
- Minimum possible final health of the last monster in a game
- GCD from root to leaf path in an N-ary tree
- Number of Quadruples with GCD equal to K
- Lexicographically largest permutation of the array such that a[i] = a[i-1] + gcd(a[i-1], a[i-2])
- Sum of GCDs of each row of the given matrix
- Smallest divisor D of N such that gcd(D, M) is greater than 1
- Maximize profit when divisibility by two numbers have associated profits
- Check if all the elements can be made equal on dividing with X and Y

Given an array a of size N. The task is to find a subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3])… Read More »

Given an array arr[] of size N (N > 2). The task is to find lexicographically largest permutation of the array such that arr[i] =… Read More »

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 »