K-th Not Divisible by n Problem

K-th Not Divisible by n Problem — ExecCode Medium DSA Practice

Solve the K-th Not Divisible by n problem on ExecCode. Free online medium DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given integers n and k, return the k-th positive integer that is not divisible by n. Return the k-th positive integer not divisible by n. You are given: n — n k — k Return the k-th positive integer not divisible by n. Copied from OA Lab Part 1.

Examples

Input {'n': 3, 'k': 3}; Output 4. Input {'n': 3, 'k': 2}; Output 2. Input {'n': 3, 'k': 1}; Output 1

Constraints

Follow the statement. Use a 64-bit integer when values can overflow.

Practice K-th Not Divisible by n free on ExecCode. Browse DSA problems, topic map, and placement guides.