#include #include #include #define MIN(A,B) ((A)<(B))?(A):(B) #define MAXDIM 100 int front[MAXDIM]; int right[MAXDIM]; int Cmp(const void * ptr1, const void *ptr2) { int a, b; a = *((const int *)ptr1); b = *((const int *)ptr2); if (ab) return 1; return 0; } int main(void) { int i, j, k, n, max, min; scanf("%d", &n); while(n--){ scanf("%d", &i); for (j= 0;j1){ qsort(front, i, sizeof(int), Cmp); qsort(right, i, sizeof(int), Cmp); } min = j = k = 0; while((j < i) && (k