1 solutions

  • 0
    @ 2025-11-5 16:41:39

    C++ :

    #include <cstdio>
    using namespace std;
    int gcd(int x, int y)
    {
        int t;
        while(y > 0){
            t = x % y;
            x = y;
            y = t;
        }
        return x;
    }
    
    int main()
    {
        int i, ans = 0;       
        int x, y, t, s;
        scanf("%d%d", &x, &y);
        t = x * y;
        for(i = x; i <= y; i += x){
            s = t / i;
            if((s * i == t) && (gcd(s, i) == x)){
                ans++;
            }
        }
        printf("%d\n", ans);
        return 0;
    }
    
    
    • 1

    Information

    ID
    17941
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By