#include #include #include #include #include using namespace std; #define LL long long const int maxn = 100005; int a[maxn]; int main() { int T,n,m; ///freopen("in.txt","r",stdin); scanf("%d",&T); while(T--){ scanf("%d%d",&n,&m); LL sum = 0; for(int i = 0;i=n)printf("%d\n",n); else{ sort(a,a+n-1); for(int i = 0;i