#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long tt;
  cin >> tt;
  while (tt--) {
    long long x, y, x1, y1;
    cin >> x >> y >> x1 >> y1;
    if (y == y1) {
      cout << llabs(x - x1) << "\n";
    } else if (x == x1) {
      cout << llabs(y - y1) << "\n";
    } else {
      cout << llabs(x - x1) + llabs(y - y1) + 2 << "\n";
    }
  }
  return 0;
}
