Help me in solving POLTHIEF problem idk where am i missing

My issue

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int x,y;
	    cin>>x>>y;
	    if(x>y)
	    cout<<x-y<<endl;
	    else
	    cout<<y-2*x +1<<endl;
	    
	}
	return 0;
}

Problem Link: POLTHIEF Problem - CodeChef

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int x,y;
	    cin>>x>>y;
	    if(x>y)
	    cout<<x-y<<endl;
	    else
	    cout<<(y-x)<<endl;// just use y-x 
	    
	}
	return 0;
}