#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    long long ans = abs(x1 - x2) + abs(y1 - y2) + 2 * (x1 != x2 && y1 != y2);
    cout << ans << endl;
  }
  return 0;
}
