e-olymp
Problems

n-th term divisible by a or b

n-th term divisible by a or b

Given two integers a and b. Find the n-th term which is divisible by either of a or b.

Input

Three integers a, b and n (a, b, n109).

Output

Print the n-th term divisible by either a or b. It is known that the answer is no more than 109.

prb9018.gif

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 5 10
Output example #1
16
Input example #2
3 7 25
Output example #2
57