Language: C++

#include <bits/stdc++.h>

#define lli long long double
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

void swap(lli *a,lli *b){
	lli tmp = *a;
	*a = *b;
	*b = tmp;
}

int main(){

	lli q;
	cin>>q;
	REP(i,q){
		lli a,b;
		cin>>a>>b;
		lli target = a*b;
		lli num = sqrt(target);
		lli flagA=0,flagB=0;
		if(a==1 && b==1){
			cout<<0<<endl;
			continue;
		}

		if(num*num == target){
			num--;
			flagA=1;
		}
		if(a>b){
			swap(&a,&b);
		}
		lli ans = num*2;
		if(a<=num && a!=b){
			//cout<<"testA"<<endl;
			ans--;
		}
		if( (target/num) ==num){
			//cout<<"testB"<<target/num<<" "<<a<<endl;
			ans--;
		}
		if( (target/num) ==b && flagA==0){
			//cout<<"testB"<<target/num<<" "<<a<<endl;
			ans--;
		}
		cout<<ans<<endl;
	}

	return 0;
}

Compiler output:
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:8:11: note: in expansion of macro 'lli'
    8 | void swap(lli *a,lli *b){
      |           ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:8:18: note: in expansion of macro 'lli'
    8 | void swap(lli *a,lli *b){
      |                  ^~~
a.cc: In function 'void swap(double*, double*)':
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:9:9: note: in expansion of macro 'lli'
    9 |         lli tmp = *a;
      |         ^~~
a.cc: In function 'int main()':
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:16:9: note: in expansion of macro 'lli'
   16 |         lli q;
      |         ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:19:17: note: in expansion of macro 'lli'
   19 |                 lli a,b;
      |                 ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:19:17: note: in expansion of macro 'lli'
   19 |                 lli a,b;
      |                 ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:21:17: note: in expansion of macro 'lli'
   21 |                 lli target = a*b;
      |                 ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:22:17: note: in expansion of macro 'lli'
   22 |                 lli num = sqrt(target);
      |                 ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:23:17: note: in expansion of macro 'lli'
   23 |                 lli flagA=0,flagB=0;
      |                 ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:23:17: note: in expansion of macro 'lli'
   23 |                 lli flagA=0,flagB=0;
      |                 ^~~
a.cc:3:18: error: 'long long' specified with 'double'
    3 | #define lli long long double
      |                  ^~~~
a.cc:36:17: note: in expansion of macro 'lli'
   36 |                 lli ans = num*2;
      |                 ^~~