#include <bits/stdc++.h>
using namespace std;
inline long long max_(long long a, long long b) { return a > b ? a : b; }
inline long long min_(long long a, long long b) { return a < b ? a : b; }
char buf[1 << 23], *p_1 = buf, *p_2 = buf, obuf[1 << 23], *O_ = obuf;
struct Fread {
} fin, fout;
int f_;
char ch_, Endl = '\n';
inline Fread& operator>>(Fread& F, int& a) {
  f_ = 1;
  a = 0;
  ch_ = getchar();
  while (ch_ < '0' || ch_ > '9') {
    if (ch_ == '-') f_ = -1;
    ch_ = getchar();
  }
  while (ch_ >= '0' && ch_ <= '9') {
    a = (a << 3) + (a << 1) + (ch_ ^ 48);
    ch_ = getchar();
  }
  a *= f_;
  return F;
}
Fread& operator<<(Fread& F, const int& a) {
  if (a < 0) {
    *O_++ = '-';
    return F << -a;
  }
  if (a > 9) F << (a / 10);
  *O_++ = a % 10 + '0';
  return F;
}
Fread& operator<<(Fread& F, const char& c) {
  *O_++ = c;
  return F;
}
int abs_(int a) { return a > 0 ? a : -a; }
int solve(int x1, int x2, int y1, int y2) {
  if (x1 == x2) return abs_(y1 - y2);
  if (y1 == y2) return abs_(x1 - x2);
  return abs_(y1 - y2) + abs_(x1 - x2) + 2;
}
int main() {
  int T;
  fin >> T;
  while (T--) {
    int x1, y1, x2, y2;
    fin >> x1 >> y1 >> x2 >> y2;
    fout << solve(x1, x2, y1, y2) << Endl;
  }
  fwrite(obuf, O_ - obuf, 1, stdout);
  return 0;
}
