AtCoder Beginner Contest 112
D
Partition
AtCoder
⌀ 1025
原题
← C→
翻译中…

Problem Statement

翻译中…

You are given integers $N$ and $M$.

翻译中…

Consider a sequence $a$ of length $N$ consisting of positive integers such that $a_1 + a_2 + ... + a_N$ = $M$. Find the maximum possible value of the greatest common divisor of $a_1, a_2, ..., a_N$.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $1 \leq N \leq 10^5$
  • $N \leq M \leq 10^9$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Print the maximum possible value of the greatest common divisor of a sequence $a_1, a_2, ..., a_N$ that satisfies the condition.

翻译中…

样例

Input #1
3 14
Output #1
2
Consider the sequence $(a_1, a_2, a_3) = (2, 4, 8)$. Their greatest common divisor is $2$, and this is the maximum value.
Input #2
10 123
Output #2
3
Input #3
100000 1000000000
Output #3
10000
题目信息
题号
abc112_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。