Topic background
"Ding Bell Bell Bell", with the final section of the entrance examination bell ringing, three years of youthful time immediately solidified in the moment. Graduation of the joy how the enemy that parting, longing for the future still do not forget the song. More than 1000 days and nights of laughter and tears, all condensed in the graduation party, I believe, this must be the most memorable moment in life!
Title Description
In order to make the graduation party better, the teacher wants to pick out the most tacit understanding of the biggest k personal participation in the graduation party rehearsal. But how to pick it? The teacher lists the class numbers 1,2,......,n, and believes that the degree of personal understanding of K is their greatest common divisor (this is not superstition Oh ~). This is difficult for him, please help!
PS: The greatest common divisor of a number is itself.
Input/output format
Input format:
Two spaces separated by a positive integer n and K. (n>=k>=1)
Output format:
An integer that is the maximum tacit value.
Input and Output Sample input example # #:
4 2
Sample # # of output:
2
Description
"Source of the topic"
LZN Original
"Data Range"
For 20% of data, k<=2,n<=1000
For another 30% of the data, k<=10,n<=100
For 100% of data, K<=1e9,n<=1e9 (God Ben School, a large number of people)
1 #include <cstdio>2int main () {int n,k;scanf ("%d%d ", &n,&k);p rintf ("%d\n", n/k); return 0;}
(This length ...)
Reprint:
Can directly assume that the maximum common factor p is selected
Then the chosen one can be expressed as 1*p,2*p. K*p (of course this means the smallest)
Then must meet K*p<=n
So p<=n/k
Rokua P1372 is also the graduating season I Label:none