把A当作原点就可以了
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long LL;
int main()
{
LL x,y;
int t;
scanf("%d",&t);
unsigned long long z;
while(t--)
{
scanf("%lld%lld",&x,&y);
if(y>x) z=y-x;
else z=x-y;
printf("%llu\n",z);
}
return 0;
}