#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc, o;
  scanf("%d", &tc);
  for (o = 1; o <= tc; o++) {
    long long n, m, a, b, c, d, e, f, g, h, p, q, r, fr, sc, tr,
        sz = 0, tz, i, j, k, mx = LLONG_MIN, mn = LLONG_MAX;
    long long x = 0, y = 0, cnt = 0, res = 0, ans = 0, sum = 0;
    long long flg = 0, flag = 1, na = 0, as = 1;
    vector<long long> u, v, w;
    vector<pair<long long, long long> > vct;
    vector<string> vst;
    set<long long> st, nt, tt;
    map<long long, long long> mp, nq, qr;
    string str, ttr, ntr;
    cin >> a >> b >> c >> d;
    f = abs(a - c) + abs(b - d);
    if (a != c && b != d) {
      f = f + 2;
    }
    cout << f << endl;
  }
  return 0;
}
