#include <bits/stdc++.h>
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
long long power(long long x, long long y) {
  long long v = 1;
  while (y > 0) {
    if (y & 1) v = v * x;
    y = y >> 1;
    x = x * x;
  }
  return v;
}
bool isPowerOfTwo(long long x) { return x && (!(x & (x - 1))); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long test = 1;
  cin >> test;
  while (test--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      cout << abs(y2 - y1) << "\n";
      continue;
    }
    if (y1 == y2) {
      cout << abs(x2 - x1) << "\n";
      continue;
    }
    cout << abs(x1 - x2) + abs(y1 - y2) + 2 << "\n";
  }
  return 0;
}
