COOK123B-DECREM October cook off division 2 - Decreasing Srrnmieeda

Where am I going wrong??

#include<bits/stdc++.h>
using namespace std;

int main()
{

long long int t;
cin>>t;
while(t--)
{
	long long int l,r;
	cin>>l>>r;
	long long int x=l-1;
	if(l-1<=0 || r<=l || x+l<=r)
	cout<<"-1"<<endl; 
	else
	cout<<r%100000000000000000001<<endl;
}
return 0; 

}

why this, man ?

JUST DO THIS
#include <bits/stdc++.h>
#define int long long 
using namespace std;
signed main() { 
  int t ;
  cin >> t ;
  while(t--){
    int l,r ;
    cin >> l >> r;
    cout << (r-l>=l?-1:r) << '\n' ;
  }
}

YOUR CORRECTED CODE
#include<bits/stdc++.h>
using namespace std;

int main()
{

long long int t;
cin>>t;
while(t--)
{
	long long int l,r;
	cin>>l>>r;
	long long int x=l;
	if(l-1<=0 || r<=l || x+l<=r)
	cout<<"-1"<<endl; 
	else
	cout<<r%100000000000000000001<<endl;
}
return 0; 
}