P23731 [AtCoder] [ABC032A] Takahashi and Aoki's Favorite Numbers
入门
题目描述

Problem Description

Aoki likes numbers that are divisible by the integer $a$. Takahashi likes numbers that are divisible by the integer $b$.

Find the smallest integer greater than or equal to $n$ that both Aoki and Takahashi like.

Input Format

The input is given from the standard input in the following format:

$ a $ $ b $ $ n $

  • The first line contains the integer $a\ (1≦a≦100)$.
  • The second line contains the integer $b\ (1≦b≦100)$.
  • The third line contains the integer $n\ (1≦n≦20,000)$.

Output Format

Output the following to the standard output:

On the first line, output the smallest integer greater than or equal to $n$ that both Aoki and Takahashi like. Do not forget the newline at the end.

Sample Input and Output

Sample Input #1

2
3
8

Sample Output #1

12

Sample Input #2

2
2
2

Sample Output #2

2

Sample Input #3

12
8
25

Sample Output #3

48

Notes/Hints

Sample Explanation 1

$12$ is the smallest number greater than or equal to $8$ that is divisible by both $2$ and $3$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 3 8
样例输出
12