标签:
2 10 3 2 6 7 214 7 11 12 7 13 176 23 191
4 8 38 207
1 #include <cstdio> 2 #include <iostream> 3 using namespace std; 4 const int INF = 0x3f3f3f3f; 5 int main(){ 6 int n,m,theMin,theMax,T,cur; 7 scanf("%d",&T); 8 while(T--){ 9 scanf("%d %d",&n,&m); 10 theMin = theMax = 0; 11 for(int i = 0; i < m; ++i){ 12 scanf("%d",&cur); 13 theMin = max(theMin,min(n-cur,cur)); 14 theMax = max(theMax,max(n-cur,cur)); 15 } 16 printf("%d %d\n",theMin,theMax); 17 } 18 return 0; 19 }
标签:
原文地址:http://www.cnblogs.com/crackpotisback/p/4552964.html