#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int x1, x2, x3, x4;
    cin >> x1 >> x2 >> x3 >> x4;
    int ans = 0;
    ans += abs(x1 - x3) + abs(x2 - x4);
    if (x1 != x3 && x2 != x4) ans += 2;
    cout << ans << "\n";
  }
}
