K-th in the Times Table
In the N×N multiplication table (cell (i,j) holds i·j), print the K-th smallest value.
Input: one line with two integers N and K.
Output: the K-th smallest table value.
Constraints:
- 1 ≤ N ≤ 3000
- 1 ≤ K ≤ N²
Sample Tests
Input 1
3 5
Output 1
3
Input 2
1 1
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.