Description

Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n. This is the least common multiple of 2 and n.

Examples

Input:n = 5
Output:10
Explanation:

LCM(2, 5) = 10.

Input:n = 1
Output:2
Explanation:

LCM(2, 1) = 2. Since 1 divides every integer, the smallest positive integer divisible by both 2 and 1 is simply 2.

Input:n = 9
Output:18
Explanation:

LCM(2, 9) = 18. Since 2 and 9 share no common factors (gcd = 1), their LCM is their product: 2 × 9 = 18.

Constraints

  • 1 ≤ n ≤ 150

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!