luogu#P1372. 又是毕业季I
又是毕业季I
Background
"Ding-ling-ling-ling." With the ringing of the final bell of the Gaokao, three years of youth are frozen in this moment. The joy of graduation cannot outweigh the sorrow of parting; while looking forward to the future, we still do not forget the songs of the past. Over days and nights of laughter and tears are condensed into the graduation party. We believe this must be one of the most unforgettable moments in a lifetime.
Problem Description
To make the graduation party better, the teacher wants to select students with the highest compatibility to participate in the rehearsal. But how to choose? The teacher lists all student numbers and believes that the compatibility level of 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 and .
Output Format
A single integer: the maximum compatibility value.
4 2
2
Hint
For of the testdata, , .
For another of the testdata, , .
For of the testdata, , , (a "Shenben" school, many students).
Translated by ChatGPT 5