#include #include using namespace std; int lenasort(int nums[]) { int l=sizeof(nums)/sizeof(int); if (l < 1) { return -1; } int pivot = nums[0]; int less[l]; int more[l]; for (int i = 0; i < l; ++i) { // Comparison if (nums[i] < pivot) { less[i]=(nums[i]); } else { more[i]=(nums[i]); } } int ans = lenasort(less) + pivot + lenasort(more); return ans; } int main() { int q; cin>>q; while(q--) { int len,c; cin>>len>>c; int a[len]; for(int i=0;i