#include <bits/stdc++.h>
using namespace std;
long long arr[500000];
long long howMany(long long x, long long y, long long a, long long b) {
  if (x == a && y == b) return 0;
  if (y == b) return abs(x - a);
  if (x == a) return abs(y - b);
  return 2 + abs(x - a) + howMany(a, y, a, b);
}
int main() {
  long long t, n, temp, mod = 1000000000 + 7, cpow = 0, x, y, a, b;
  cin >> t;
  while (t--) {
    cin >> x >> y >> a >> b;
    cout << howMany(x, y, a, b) << "\n";
  }
}
