#include #include int main (){ int t; scanf ("%d",&t); while (t--){ int n,m,a[100005],b[5005],x,flag=0; memset(b,0,sizeof(b)); long long sum=0; scanf ("%d%d",&n,&m); for (int i=0;i