Given an integer C, the task is to find the minimum possible value of max(A, B) such that LCM(A, B) = C.
Input: C = 6
max(1, 6) = 6
max(2, 3) = 3
and min(6, 3) = 3
Input: C = 9
Approach: An approach to solve this problem is to find all the factors of the given number using the approach discussed in this article and then find the pair (A, B) that satisfies the given conditions and take the overall minimum of the maximum of these pairs.
Below is the implementation of the above approach:
- Remove minimum numbers from the array to get minimum OR value
- Find minimum x such that (x % k) * (x / k) == n | Set-2
- Minimum LCM and GCD possible among all possible sub-arrays
- Minimum possible sum of array B such that AiBi = AjBj for all 1 ≤ i < j ≤ N
- Minimum possible value of (i * j) % 2019
- Minimum value possible of a given function from the given set
- Minimum value of N such that xor from 1 to N is equal to K
- Find the value of N when F(N) = f(a)+f(b) where a+b is the minimum possible and a*b = N
- Find minimum x such that (x % k) * (x / k) == n
- Add minimum number to an array so that the sum becomes even
- Remove one element to get minimum OR value
- Minimum number with digits as 4 and 7 only and given sum
- Find minimum possible values of A, B and C when two of the (A + B), (A + C) and (B + C) are given
- Find the minimum value of X for an expression
- Longest sub-sequence with minimum LCM
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.