Title: https://nanti.jisuanke.com/t/25985
Test instructions
Let you find any two addend that match Goldbach conjecture.
Ideas:
The number is too large to be tested with Miller-rabin primes.
#include <bits/stdc++.h> #define LL unsigned long long int using namespace STD;
ll Modmul (ll a,ll b,ll N) {//Fast product modulo a*b%n ll ans=0;
while (b) {if (b&1) ans= (ans+a)%n;
A= (a+a)%n;
b>>=1;
} return ans;
} ll Modexp (ll a,ll b,ll N) {//Quick power modulo a^b%n ll Ans=1;
while (b) {if (b&1) Ans=modmul (ans,a,n);
A=modmul (A,a,n);
b>>=1;
} return ans;
} bool Miller_rabin (ll N) {//miller-rabin Prime detection algorithm ll i,j,a,x,y,t,u,s=10;
if (n==2) return true; if (n<2| |!
(n&1))
return false; for (t=0,u=n-1;! (u&1); t++,u>>=1);
N-1=u*2^t for (i=0;i<s;i++) {A=rand ()% (n-1) +1;
X=modexp (A,u,n);
for (j=0;j<t;j++) {Y=modmul (x,x,n);
if (y==1&&x!=1&&x!=n-1) return false;
X=y;
} if (x!=1) return false;
} return true; } int main () {Srand (TimE (NULL));
ll N,t;
cin>>t;
while (t--) {scanf ("%lld", &n);
if (n==4) cout<<2<< "" <<2<<endl; for (ll i=3;i<=n/2;i+=2) {if (Miller_rabin (i) &&miller_rabin (n-i)) {printf ("%lld%lld\
n ", i,n-i);
Break
}}} return 0;
}