#include <bits/stdc++.h>
using namespace std;
long long int t, x, y, x2, y2;
vector<long long int> a;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> x >> y >> x2 >> y2;
    if (x == x2 && y != y2) {
      a.push_back(abs(y2 - y));
      continue;
    }
    if (y == y2 && x != x2) {
      a.push_back(abs(x - x2));
      continue;
    }
    if (x == x2 && y == y2) {
      a.push_back(0);
      continue;
    }
    a.push_back(abs(x2 - x) + abs(y2 - y) + 2);
  }
  for (int i = 0; i < a.size(); ++i) cout << a[i] << "\n";
}
