#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, x, y, x2, y2, ans, p, q;
  cin >> t;
  while (t--) {
    cin >> x >> y >> x2 >> y2;
    if (x == x2 || y == y2) {
      if (x2 - x)
        ans = abs(x2 - x);
      else if (y2 - y)
        ans = abs(y2 - y);
      else
        ans = 0;
    } else {
      ans = abs(x2 - x) + abs(y2 - y) + 2;
    }
    cout << ans << endl;
  }
  return 0;
}
