TouchStone
  Please Login
Login Sign Up
距离明年CSP第一轮: ??天 距离CSP第二轮: ??天 距离NOIP还有: ??天
 Homepage  Problem Set  Examinations  Submissions  Discussions  Statistics
  • Home
  • Problem Set
  • P3684
  • Problem
  • P3684GCD的个数
    Limits : Time Limit : - MS   Memory Limit : 65536 KB
    Judgment Tips : 时限:1000ms
    Description

    给定两个正整数N,M, 求满足下列两个条件的X的个数:
    条件1:1<=X<=N
    条件2:gcd(X,N)>=M

    Input Format

    一行,两个整数N和M

    Output Format

    一行,一个整数,表示所求结果

    Sample Input 1

    10 2

    Sample Output 1

    6

    Sample Input 2

    10000 72

    Sample Output 2

    260

    Hint

    2<=N<=1000000000, 1<=M<=N


    Source  hdu2588