No.1350 2019-6problem
タグ : / 解いたユーザー数 143
作問者 :
KoD
maguro
PCTprobability
Problem Statement
You are given positive integers $A,B,K$.
Arrange the positive integers that are multiples of $A$ or multiples of $B$ in ascending order, and output the $K$-th smallest number.
Input
$A\ B\ K$
- All inputs are integers.
- $1\leq A,B,K\leq 10^9$
Output
Output the $K$-th smallest number on one line. Print a newline at the end.
Sample
Sample 1
Input
2 3 5
Output
8
Arranging the positive integers that are multiples of $2$ or multiples of $3$ in ascending order gives $2,3,4,6,8,9, \cdots$. The $5$-th number in this sequence is $8$, so output $8$.
Sample 2
Input
89 113 50
Output
2492
This is Question 6 from Day 1 of the 2019 Nada Junior High School entrance examination.
Sample 3
Input
22 37 43
Output
594
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。