Least Common Multiple of at Least Three Numbers
InterviewTime limit2sMemory limit128 MB
Given five distinct positive integers up to 100, find the smallest number divisible by at least three of them, essentially the minimum LCM over all triples.
- Level
Easy3 of 10
- Topics
- Math, Brute force, Number theory, Combinatorics
- Solved
- No attempts yet
Problem
Five distinct positive integers are given. Find the smallest positive integer that is divisible by at least three of the five given numbers.
Input
The first line contains five distinct positive integers separated by spaces. Each integer is at most 100.
Output
Print the smallest positive integer that is divisible by at least three of the five given numbers.