#P1372. 又是毕业季I

又是毕业季I

Description

To make the graduation party better, the teacher wants to select kk students with the highest compatibility to participate in the rehearsal. But how to choose? The teacher lists all student numbers 1,2,,n1, 2, \ldots, n and believes that the compatibility level of kk students is their greatest common divisor (this is not superstition~). This is difficult for him, so please help!

PS: The greatest common divisor of a single number is the number itself.

Input Format

Two space-separated positive integers nn and kk.

Output Format

A single integer: the maximum compatibility value.

4 2

2

Hint

For 20%20\% of the testdata, k2k \le 2, n103n \le 10^3.

For another 30%30\% of the testdata, k10k \le 10, n100n \le 100.

For 100%100\% of the testdata, k109k \le 10^9, n109n \le 10^9, nk1n \ge k \ge 1 (a "Shenben" school, many students).

Translated by ChatGPT 5