#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 9;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t, n, tc = 0, a, b, c, d;
  cin >> t;
  while (t--) {
    tc++;
    cin >> a >> b >> c >> d;
    if (a == c || b == d) {
      cout << abs(a - c) + abs(b - d) << endl;
    } else {
      cout << abs(a - c) + abs(b - d) + 2 << endl;
    }
  }
  return 0;
}
