## Find the ratio of LCM to GCD of a given Array

Given an array arr[] of positive integers, the task is to find the ratio of LCM and GCD of the given array. Examples: Input: arr[]… Read More »

- Must do Math for Competitive Programming
- Sum of GCD of all possible sequences
- Longest sub-array with maximum GCD
- Maximum GCD of all subarrays of length at least 2
- Length of the Smallest Subarray that must be removed in order to Maximise the GCD
- Find the GCD of LCM of all unique pairs in an Array
- Minimum operations required to make two numbers equal
- Common divisors of N numbers
- Check if the square of a number is divisible by K or not
- Count of numbers upto M with GCD equals to K when paired with M
- Count of pairs upto N such whose LCM is not equal to their product for Q queries
- Split N natural numbers into two sets having GCD of their sums greater than 1
- Minimum LCM of all pairs in a given array
- Find GCD of each subtree of a given node in an N-ary Tree for Q queries
- GCD of elements occurring Fibonacci number of times in an Array
- Length of longest subarray of length at least 2 with maximum GCD
- Find the maximum GCD of the siblings of a Binary Tree
- Sum of GCD of all numbers upto N with N itself
- Probability that an arbitrary positive divisor of 10^X is an integral multiple of 10^Y
- Find minimum GCD of all pairs in an array
- Divide N into K unique parts such that gcd of those parts is maximum
- Count of nodes in a Binary Tree whose immediate children are co-prime
- Print all distinct Coprime sets possible from 1 to N
- Two Balls Reachability Game
- Print any pair of integers with sum of GCD and LCM equals to N
- Count all pairs of divisors of a number N whose sum is coprime with N

Given an array arr[] of positive integers, the task is to find the ratio of LCM and GCD of the given array. Examples: Input: arr[]… Read More »

Given a number N, the task is to find a pair of integers in the range [2, N] with maximum GCD. Examples: Input: N =… Read More »

Given an integer array arr[] and an integer K, the task is to count all triplets whose GCD is equal to K. Examples: Input: arr[]… Read More »

Given an integer N, the task is to count all pairs of divisors of N such that the sum of each pair is coprime with… Read More »

Given an N-ary Tree containing N nodes, values associated with each node and Q queries, where each query contains a single node. The task is… Read More »

Given two numbers X and Y, the task is to find the probability that an arbitrary positive divisor of 10X is an integral multiple of… Read More »

Given an array arr[] of size N, the task is to find the minimum LCM (Least Common Multiple) of all unique pairs in the given… Read More »

Given an integer N, the task is to find all distinct co-prime sets up to the given integer N such that an element doesn’t appear… Read More »

Given an integer N, the task is to find the sum of Greatest Common Divisors of all numbers up to N with N itself. Examples:… Read More »

Given an integer array arr[] of size N, the task is to find the GCD of LCM of all unique pair (i, j) of the… Read More »

Given an integer N, the task is to print any pair of integers that have the sum of GCD and LCM equal to N. Examples:… Read More »

Given an array arr[] of length N, the task is the find the length of longest subarray of length at least 2 with maximum possible… Read More »

Given an integer N, the task is to create two sets of distinct elements from 1 to N such that the gcd of their respective… Read More »

Given two integers, X and K, the task is to find if X2 is divisible by K or not. Here, both K and X can… Read More »

Competitive Programming (CP) doesn’t typically require to know high-level calculus or some rocket science. But there are some concepts and tricks which are sufficient most… Read More »