1 solutions

  • 0
    @ 2025-3-3 16:33:39

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        long long m,n,i,c = 0,x;
        cin>>m>>n;
        x = m * n;
        for(i = 2;i <= sqrt(x);i++){
        	if(x % i == 0 && i != m){
        		c++;
    		}
    	}
    	
    	cout<<c<<endl;
    	return 0;
    }
    

    Python :

    m,n=list(map(int,input().split()))
    #n=int(input())
    c=m*n
    sum=0
    for i in range(2,int(c**0.5)+1):
        if c%i==0 and i<=c//i and i!=min(m,n):
            sum=sum+1
    print(sum)
    
    
    • 1

    Information

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