#include <iostream>
#include <fstream>

using namespace std;

int main()
{
	ifstream in("SEGMENT.IN");

	int n;
	in>>n;
	while(n--)
	{
		long x1,x2,y1,y2;
		in>>x1>>y1>>x2>>y2;
		int t1,t2;
		if(x2>x1)
			t1=x2-x1;
		else
			t1=x1-x2;
		if(y2>y1)
			t2=y2-y1;
		else
			t2=y1-y2;

		if(t1==t2)
		{
			cout<<labs(t1+1)<<endl;
			continue;
		}
		if(t1>t2)
		{
			cout<<labs(t1+1)<<endl;
			continue;
		}
		else
			cout<<labs(t2+1)<<endl;
	}

	return 0;
}