Express any even number as a sum of two prime number

PHOTO EMBED

Fri Aug 20 2021 15:58:07 GMT+0000 (UTC)

Saved by @faisals

void solve(int a,vector<int> &ans){
    
    if(a==4){
        ans.push_back(2);
        ans.push_back(2);
        return ;
    }
    
    //mereko even number as a sum of two prime number likhna hai
    for(int k=a-3;k>=3;k-=2){
        if(isPrime(k)&& isPrime(a-k)){
            ans.push_back(k);
            ans.push_back(a-k);
            return  ;
        }
    }
    
    return;
    
}
content_copyCOPY

https://codeforces.com/problemset/status?my