Luo Gu P1372 is graduation season I

https://www.luogu.org/problem/P1372

 

#include <bits / STDC ++ H.>
 the using  namespace STD;
 Long  Long n-, K;
 int main () { 
    CIN >> >> n- K; 
    COUT << n-/ K;
     return  0 ; 
} 
/ * from 1 ~ n in take the number of k, k the greatest common divisor of the biggest this number 
when two numbers into multiple relations, the common denominator is their smaller numbers 
in this problem, k digits in fact, x * 1, x * 2 ...... x * k, and 1 ~ k x times, but must ensure that x * k is less than n 
under the above conditions, to know, meet the requirements of the largest x is the answer, to find the greatest x, x * k must be as close to n, 
since c ++ integer division automatic rounding function, so in all cases, n / k is the final answer, and is an integer * /

 

Guess you like

Origin www.cnblogs.com/QingyuYYYYY/p/11704971.html