I doont know where iam going wrong

#include
#include
#include
using namespace std;
int main(){
int t;
cin>>t;

map<int,int > a;
while(t--){
	
	int n;
	cin>>n;
	int k=n;
	int occur=0;
	for(int i=2;i*i<=n;i++){
		occur=0;
		if(n%i==0){
			while(n%i==0){
				occur++;
				n=n/i;
			}
				a[i]=occur;
		}
		
	
	}
	if(n!=1){
	
	a[n]=1;}
	
	
	int count=0;
	
	
	if(a.size()>=3){
	
		
		cout<<"YES"<<endl;
		int count=0;
		for(auto it=a.begin();it!=a.end();it++){
			count++;
			if(count==3){
				break;
			}
			int x=pow(it->first,it->second);
			cout<<x<<" ";
		    k=k/x;	
		}
		cout<<k<<endl;
	}
	
	if(a.size()==1){
		
           int u=a.begin()->first ; 

		if(a.begin()->second>=6){
			cout<<"YES"<<endl<<u<<" "<<u*u<<" "<<k/(u*u*u)<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
		
	}
	
	if(a.size()==2){
	
		int  b[2];
		auto it=a.begin();
		b[0]=it->first;
		it++;
		b[1]=it->first;
		if(k/(b[0]*b[1])!=b[0]||k/(b[0]*b[1])!=b[1]){
			cout<<"YES"<<endl<<b[0]<<" "<<b[1]<<" "<<k/(b[0]*b[1])<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
	
	
	a.clear();	
	
	
	}
	
	
}

share code in cb ide please

how to share in
cd ide


go here
paste ur code which needs to be debugged
in the file option press save u`ll get a updated url
share that url here

it is running in dev cpp .

it is also running for given test cases in codeforces but i am getting wrong answer can uplease check it sir

i will help u out give me 20-25 minutes

1 Like

image
i suppose u are not printing correct factors

would u like to check it by urself??
since the algo is easy
u can use set to check if the factor u are printing is unique or not

1 Like

i coorected it bro still getting wrong answer

share link of question … the codeforces q link


wrong on test case 3;
https://codeforces.com/problemset/problem/1294/C

https://codeforces.com/contest/1294/submission/86987698
my solution

sorry bro i got it accepted i changed compiler

oh wow
great
share the updated code so that i can see for myself

thanks a lot…