#include <bits/stdc++.h>
using namespace std;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  io();
  int t;
  cin >> t;
  while (t--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a == c)
      cout << abs(d - b) << "\n";
    else if (b == d)
      cout << abs(a - c) << "\n";
    else {
      cout << abs(a - c) + abs(d - b) + 2 << "\n";
    }
  }
  return 0;
}
