/* -*- coding: utf-8 -*- * * 3163.cc: No.3163 [Cherry 7th Tune N] Draft - yukicoder */ #include #include using namespace std; /* constant */ const int N = 5; /* typedef */ /* global variables */ int as[N]; /* subroutines */ /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { for (int i = 0; i < N; i++) scanf("%d", as + i); int x = *max_element(as, as + N); int y = *min_element(as, as + N); printf("%d\n", x - y); } return 0; }