➤ Problem Link : 1326A. Bad Ugly Numbers
✅ C++ Solution :
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
if(n==1)
{
cout<<"-1\n";
continue;
}
string s="";
for(int i=1;i<n;i++)
s+='5';
s+='4';
cout<<s<<endl;
}
}
Thank you for your patience reading. If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Whatsapp or Facebook.
😇Happy Learning!!
