問題一覧 > 通常問題

No.1350 2019-6problem

レベル : / AI推定難易度 : 625 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 143
作問者 : 8UqsVg4r / テスター : KoD maguro blackyuki PCTprobability
お気に入りにしたユーザー ProblemId : 5758 / 自分の提出
問題文最終更新日: 2021-02-20 13:57:31
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
灘中入試コンテストday2 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。