An ugly number is divisible by a, b, or c. Find the nth ugly number.
Example: a = 2, b = 3, c = 5, n = 4. Ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10, 12, 15... The 4th is 5.
Constraints: 1 ≤ n ≤ 10^9, 1 ≤ a, b, c ≤ 10^9. Same structure as Nth Magical Number but with three divisors.