#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, m, i, j, t, r, d, s, l, ans = 0;
  cin >> t;
  while (t--) {
    ans = 0;
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    ans = abs(x2 - x1);
    ans += abs(y2 - y1);
    if (x1 != x2 && y1 != y2) ans += 2;
    cout << ans << endl;
  }
}
