#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int INF = 1e9 + 7;
const int N = 2e5 + 7;
const int M = 1e6 + 7;
signed main() {
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    int a, b, c, d;
    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;
}
