What's wrong in my code for FALSNUM?

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll fd(ll n){
while(n>=10)
{
n/=10;
}
return n;
}
int main()
{

ll t;
cin>>t;
while(t--)
{
   ll n;
   cin>>n;
 
  ll u = fd(n);
   if(u>1)
   {
       cout<<1<<n<<endl;
   }else if(u==1) {
     string s=to_string(n);
     cout<<s[0]<<0;
     for(ll i=1;i<s.size();++i)
     {
         cout<<s[i];
     }cout<<endl;
   }
}


 return 0;

}

You tried to take input in long long variable which will obviously give error as length of input is upto 5000 (which will not be stored in long long).

Try taking input in string directly. Also maybe you have to change your fd() function accordingly.