#ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG // []で配列外参照をするとエラーにしてくれる。上下のやつがないとTLEになるので注意 #endif #include using namespace std; // #include // using namespace atcoder; // #include // using namespace boost::multiprecision; using ll = long long; using Graph = vector>; ll INF = 2e18 + 1; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; for (;T--;){ int a, b, c, d, e; cin >> a >> b >> c >> d >> e; cout << (max({a, b, c, d, e}) - min({a, b, c, d, e})) << endl; } }