On the remaining number of lines --cf1089F

About prime modulus and good topic

/ * 
N-two prime factors x, y + by = n-have-AX. 1 
    AX + by =. 1-n- 
    AX + by +. 1 = n- 
    Y | AX +. 1 
    GCD (x, y) =. 1 
    AX% Y, A take [1, y-1], there will be [1, y-1] of distinct values 
    which it must have y-1 Y |. 1 AX + 
AX +. 1 <= (y-1). 1 = X + XY -y + 1 <= n, so there must be A, B 
* / 
#include <bits / STDC ++ H>.
 the using  namespace STD;
 #define LL Long Long 
LL n-; 
LL primes [ 100 ], m;
 int main () { 
    CIN >> n-; 
    LL tmp = n-;
     for (LL = I 2 ; I * I <= n-; I ++ )
         IF (tmp% I == 0 ) {
            primes[++m]=i;
            while(tmp%i==0)tmp/=i;
        }
    if(tmp>1)primes[++m]=tmp;
    if(m<=1){
        puts("NO");
        return 0;
    }
    puts("YES");
    puts("2");
    
    ll a,b,x=primes[1],y=primes[2];
    for(a=1;a<=y-1;a++){
        if((a*x+1)%y==0){
            b=(n-1-a*x)/y;
            break;            
        }
    }
    cout<<a<<" "<<n/x<<'\n';
    cout<<b<<" "<<n/y<<'\n'; 
}

 

Guess you like

Origin www.cnblogs.com/zsben991126/p/10929502.html