Under construction

Still being built. Things may change

Least Common Multiple of at Least Three Numbers

Interview

Time limit2sMemory limit128 MB

Summary
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.

Examples4

  1. Example 1

    Input
    30 42 70 35 90
    
    Expected output
    210
  2. Example 2

    Input
    1 2 3 4 5
    
    Expected output
    4
    
  3. Example 3

    Input
    30 45 23 26 56
    
    Expected output
    1170
    
  4. Example 4

    Input
    3 14 15 92 65
    
    Expected output
    195