1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| #include <bits/stdc++.h> #define ll long long #define int ll #define ios ios::sync_with_stdio(0) #define FOR(i,n) for(int i=0;i<n;i++) using namespace std; int t;
void solve(){ int k;cin>>k; int a = ceil(sqrt(pow(10,(k-1)))); for(int i=a;;i++){ string s = to_string(i*i); int len = s.size(),flag = 0; for(int i=0;i<len;i++){ if((s[i]-'0')%2!=0){ flag = 1; break; } } if(flag==0){ cout<<i*i<<endl; break; } } }
signed main(){ ios; cin>>t; while(t--){ solve(); } }
|