#BS0000014. Số thứ k không chia hết cho n (K-th Not Divisible by n)
Số thứ k không chia hết cho n (K-th Not Divisible by n)
K-th Not Divisible by n
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers and , consider all positive integers not divisible by , in increasing order. Find the -th number in this sequence.
Input
One line contains and .
Output
Print the -th positive integer not divisible by .
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: , .
Examples
Input
3 7
Output
10
Explanation
The sequence is , so the seventh element is .