fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. int t,n; cin >> t;
  7. while(t--){
  8. cin >> n;
  9. if(n == 1 || n == 3) cout << "-1\n";
  10. else if(n%2 == 0){
  11. for(int i = 0; i<n-2; i++) cout << "3";
  12. cout << "66\n";
  13. }else{
  14. for(int i = 0; i<n-5; i++) cout << "3";
  15. cout << "36366\n";
  16. }
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5272KB
stdin
6
1
2
3
4
5
7
stdout
-1
66
-1
3366
36366
3336366