#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
const double eps = 1e-7;
const int maxn = 2e5 + 10;
const int prime[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
const int dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
int spgcd(int a, int b) {
  while (b ^= a ^= b ^= a %= b)
    ;
  return a;
}
inline int mul(int a, int b, int p) { return (long long)a * b % p; }
using namespace std;
void solve() {
  long long x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  long long ans = abs(x1 - x2) + abs(y1 - y2);
  if (x1 - x2 && y1 - y2) ans += 2;
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) solve();
  return 0;
}
