Skip to content

Tag Archives: GCD-LCM

Given two integer P and Q, the task is to find the value of P and modular inverse of Q modulo 998244353. That is  Note:… Read More
Given an integer N, the task is to find the maximum possible GCD of a pair of integers such that their sum is N. Examples… Read More
Given an integer N, the task is to find the maximum possible GCD among all pair of integers with product N.Examples: Input: N=12 Output: 2 Explanation: All possible… Read More
Given an integer N greater than 2, the task is to find an element M such that GCD(N, M) is maximum. Examples: Input: N =… Read More
Given an array arr[] which denotes the integer coefficients of the polynomial, the task is to find the content of the polynomial.  Content of polynomials… Read More
Given a decimal number as N, the task is to convert N into an equivalent irreducible fraction. An irreducible fraction is a fraction in which… Read More
Given an integer N, the task is to print all proper fractions such that the denominator is less than or equal to N.  Proper Fractions:… Read More
Given three integers a, b, and c representing a linear equation of the form: ax + by = c. The task is to find the… Read More
Given an array A[] of size N, the task is to maximize the count of distinct elements in the array by inserting the absolute differences… Read More
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 = 10 Output:… 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