Help me in solving MAKEDIV3 problem

My issue

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t,z;
	cin>>t;
	while(t--){
	    int n;
	    cin>>n;
	    for(int i=pow(10,n-1);i<pow(10,n);i++){
	        if(i%3==0&&i%2!=0&&i%9!=0){
	            cout<<i<<endl;
	            break;
	        }
	    }
	    
	}
	return 0;
}

Problem Link: CodeChef: Practical coding for everyone