#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x, x1, y, y1;
    cin >> x >> y >> x1 >> y1;
    int ans = abs(x1 - x) + abs(y1 - y);
    cout << (x == x1 || y == y1 ? ans : ans + 2) << endl;
  }
  return 0;
}
