// User name:- Ankit singh // Codechef id:- ankitsingh3003 // Codeforces Id:- ankit_singh_programs // Email- ankitsingh300307@gmail.com (if you want to contact me) // About Me // Just a newbie Competetve programmer and I am IOI aspirant #define in include #include #include #include #include #include #include #include #include // New Imports:- using namespace std; // Definitions // Copied from GFG geeks for geeks typedef long long LL; typedef pair pii; typedef pair pll; typedef pair pss; typedef vector vi; typedef vector vvi; typedef vector vii; typedef vector vl; typedef vector vvl; double EPS = 1e-9; long long inf = 1000000000000000005LL; double PI = acos(-1); int dirx[8] = { -1, 0, 0, 1, -1, -1, 1, 1 }; int diry[8] = { 0, 1, -1, 0, -1, 1, -1, 1 }; #ifdef TESTING #define DEBUG fprintf(stderr, "====TESTING====\n") #define VALUE(x) cerr << "The value of " << #x << " is " << x << endl #define debug(...) fprintf(stderr, __VA_ARGS__) #else #define DEBUG #define VALUE(x) #define debug(...) #endif #define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a)) #define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a)) #define FORD(a, b, c) for (int(a) = (b); (a) >= (c); --(a)) #define FORSQ(a, b, c) for (int(a) = (b); (a) * (a) <= (c); ++(a)) #define FORC(a, b, c) for (char(a) = (b); (a) <= (c); ++(a)) #define FOREACH(a, b) for (auto&(a) : (b)) #define REP(i, n) FOR(i, 0, n) #define F(i, n) FORN(i, 1, n) #define MAX(a, b) a = max(a, b) #define MIN(a, b) a = min(a, b) #define SQR(x) ((LL)(x) * (x)) #define RESET(a, b) memset(a, b, sizeof(a)) #define fi first #define se second #define mp make_pair #define pb push_back #define ALL(v) v.begin(), v.end() #define ALLA(arr, sz) arr, arr + sz #define SIZE(v) (int)v.size() #define SORT(v) sort(ALL(v)) #define REVERSE(v) reverse(ALL(v)) #define SORTA(arr, sz) sort(ALLA(arr, sz)) #define REVERSEA(arr, sz) reverse(ALLA(arr, sz)) #define PERMUTE next_permutation #define TC(t) while (t--) // My definitions // My definitions #define lo long long #define in int #define ma main #define fl float #define st string #define ch char #define do double #define co cout #define ci cin #define fo for #define wh while #define so sort #define tr true #define fa false #define su substr #define le length #define el else #define ve vector #define re return #define si size #define er erase #define re remove #define ad add #define ll long long ll mod=pow(10,9)+7; //ll mod2= //ll func(){ // //} inline ll fact(ll n){ ll r=1; for(ll i=1;i<=n;++i){ r*=i; r%=mod;} return r; } inline ll ncr(ll n,ll k){ return fact(n)/(fact(k)*fact(n-k)); } inline ll fib(ll n){ if(n==0) return 0; if(n==1) return 1; ll k; if(n%2==1){ k=(n+1)/2; return (fib(k-1)*fib(k-1))+(fib(k)*fib(k)); } else{ k=n/2; return (fib(k-1)+fib(k))*fib(k); } n%=mod; } ll fastmod(ll n,ll b){ ll a=n/b; a*=b; return (n-a); } ll plg(ll n,ll b){ b%=mod; ll a=n/2; if(n==0) return 1; else if(n==1) return b; else{ ll c=1; if(n%2==1){ c=plg(a,b); c%=mod; c*=c; c%=mod; c*=b; c%=mod; } else{ c=plg(a,b); c%=mod; c*=c; c%=mod; } return c; } } void print(vector arr){ for(ll i=0;i> arr){ for(ll i=0;i0) cout<<"\n"; cout<> arr){ for(ll i=0;i0) cout<<"\n"; for(ll j=0;j>t; /* string filei= string fileo= ofstream out(fileo); instream in(filei); */ while(t--){ ll a,b,c,n,i,j,q; ll m; ll r=0; string s,s1,s2; ll x,y; ll o=0; ll r1,r2; ll k; r1=r2=0; // Input cin>>n; ll low=1; ll high=n; //if(n>1) {high/=2; // it can be proved that if n>1 range of square is 1..floor(n/2) //} while(1){ ll mid=low+high; mid/=2; if(((mid*mid)==n)) { r=mid; break; } else if((mid*mid)n){ r=mid; break; } // mid*=mid; else if((mid*mid)>n){ high=mid-1; } else{ low=mid+1; } } // ll arr[n]; // // for(ll i=0;i>arr[i]; // vector arr(n); // ll ran=26; // cin>>k; // file input // // // ll arr[n]; // for(ll i=0;i>arr[i]; // in>>n; // for(ll i=0;i>arr[i]; // sort(arr,arr+n); //vector> arr; //for(ll i=0;i>a>>b; // // vector ar{a,b}; // // arr.pb(ar); // //} //for(ll i=0;i>a>>b; // // vector ar{a,b}; // // arr.pb(ar); // //} // vector d; // // n=s.le(); // // // i=0; // // while(i>ar1[i]; // // // for(ll i=0;i>ar2[i]; // for(ll i=0;i>ar1[i]; // // // for(ll i=0;i>ar2[i]; // sort(ar2,ar2+n); // sort(ar2,ar2+n); // sort(arr,arr+n,greater()); // sort(arr.begin(),arr.end()); // sort(arr.begin(),arr.end(),greater()); // // long long ar[n]; // for(int i=0;i