#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  while (n--) {
    int a1, a2, b1, b2;
    cin >> a1 >> a2 >> b1 >> b2;
    int sum = 0;
    int ver = a1 - b1;
    if (ver < 0) {
      ver = -ver;
    }
    int hor = a2 - b2;
    if (hor < 0) {
      hor = -hor;
    }
    if (hor == 0 || ver == 0) {
      sum = ver + hor;
    } else {
      sum = ver + hor + 2;
    }
    v.push_back(sum);
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  return 0;
}
