## Find two numbers with the given LCM and minimum possible difference

Given an integer X, the task is to find two integers A and B such that LCM(A, B) = X and the difference between the… Read More »

## Remove an element to minimize the LCM of the given array

Given an array arr[] of length N ≥ 2. The task is to remove an element from the given array such that the LCM of… Read More »

## Longest sub-sequence with minimum LCM

Given an array arr[] of length N, the task is to find the length of the longest sub-sequence with minimum possible LCM. Examples: Input: arr[]… Read More »

## Maximum LCM among all pairs (i, j) of first N natural numbers

Given a positive integer N > 1, the task is to find the maximum LCM among all the pairs (i, j) such that i <… Read More »

## Minimum integer such that it leaves a remainder 1 on dividing with any element from the range [2, N]

Given an integer N, the task is to find the minimum possible integer X such that X % M = 1 for all M from… Read More »

## Find the longest subsequence of an array having LCM at most K

Given an array arr[] of N elements and a positive integer K. The task is to find the longest sub-sequence in the array having LCM… Read More »

## Count pairs (i,j) such that (i+j) is divisible by A and B both

Given n, m, A and B. The task is to count the number of pairs of integers (x, y) such that 1 x n and… Read More »

## std::lcm in C++17

Competitive programming often involves computation of Least Common Multiple (LCM) of two numbers. One way of doing that is using boost::math::lcm(), which we discussed in… Read More »

## Inbuilt function for calculating LCM in C++

Many times while we do programming, we need to calculate the Least Common Multiple (LCM) between two numbers. We have already discussed how to find… Read More »

## QA – Placement Quizzes | LCM | Question 12

The least number which when divided by 5, 6, 7 and 8 leaves a remainder of 3, but when divided by 9 leaves no remainder,… Read More »

## QA – Placement Quizzes | LCM | Question 11

A, B and C start at the same time in the same direction to run around a circular track. A completes a round in 252… Read More »

## QA – Placement Quizzes | LCM | Question 10

What is the least number which is exactly divisible by 6, 12, 9 and 18? (A) 96 (B) 36 (C) 24 (D) 81 Answer: (B)… Read More »

## QA – Placement Quizzes | LCM | Question 9

What is the least number which is exactly divisible by 6, 7, 9 and 11 ? (A) 1386 (B) 1246 (C) 1122 (D) 1432 Answer:… Read More »

## QA – Placement Quizzes | LCM | Question 8

The LCM. of two numbers is 30 and their HCF. is 15. If one of the numbers is 30, then what is the other number?… Read More »

## QA – Placement Quizzes | LCM | Question 7

What is the least number which when divided by 4, 5, 6 and 7 leaves a remainder 3, but when divided by 9 leaves no… Read More »