#include #include #include #include #include #include #include #include #include #include using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<> t; for (int i=0; i> a >> b >> c; if (a > c) swap(a,c); if (a == 1 && b == 2) a = b = c = 0; { int tmp = abs(c - b) + 1; if (b - a <= 1) tmp++; ans = tmp; } { int tmp = abs(b-a) + 1; ans = min(ans, tmp); } if (a == b && b == c) ans = 3; if ((ab&&c>b)) ans = 0; if (a<=0 || b<=0 || c<=0) ans = -1; cout << ans << endl; } }