#warning "nefunguje!"
/* testcase:
1
6 4
49 16 1 55 58 78
*/
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#define MAXK 512
#define MAXM 512

      unsigned best[MAXK][MAXM + 1], move[MAXK][MAXM], input[MAXM], sums[1 + MAXM], left;
      size_t k, m, man, book, ends[MAXK];


int
main (void)
{
  unsigned n;

  scanf ("%u", &n);
  do
    {
      /* best[man][book] = best cost to get 'book' books using (man + 1) men,
	 valid for (book >= man + 1), i.e. (book > man) */

      scanf ("%zu%zu", &m, &k);
      for (book = 0; book < m; book++)
	scanf ("%u", input + book);
      sums[0] = 0;
      for (book = 0; book < m; book++)
	sums[1 + book] = sums[book] + input[book];
      for (book = 1; book <= m; book++)
	{
	  best[0][book] = sums[book];
	  move[0][book] = book;
	}
      for (man = 1; man < k; man++)
	{
#if 0
	  for (book = 0; book <= man; book++)
	    fputs("0 ", stdout);
#endif
	  for (book = man + 1; book <= m; book++)
	    {
	      size_t bound;
	      
	      best[man][book] = UINT_MAX;
	      for (bound = man; bound < book; bound++)
		{
		  unsigned val;
		  
		  val = sums[book] - sums[bound];
		  if (val < best[man - 1][bound])
		    val = best[man - 1][bound];
		  if (best[man][book] > val)
		    {
		      best[man][book] = val;
		      move[man][book] = book - bound;
		    }
		}
#if 0
	      printf ("%u ", best[man][book]);
#endif
	    }
#if 0
	  putchar ('\n');
#endif
	}
      left = m;
      man = k - 1;
      do
	{
	  ends[man] = left;
	  left -= move[man][left];
	}
      while (man-- != 0);
      assert (left == 0);
      for (man = 0; man < k; man++)
	{
	  if (man != 0)
	    fputs (" / ", stdout);
	  while (left < ends[man])
	    {
	      printf ("%u", input[left]);
	      left++;
	      if (left != ends[man])
		putchar (' ');
	    }
	}
      putchar ('\n');
    }
  while (--n != 0);
  return 0;
}
