import java.io.* ;
import java.util.* ;
import java.awt.* ;
import java.math.* ;
new Thread ( null ,
new Main
( ) ,
"Main" ,
1 << 28 ) .
start ( ) ; }
public void run( ) {
InputReader reader
= new InputReader
( System .
in ) ;
int CASES = reader.readInt ( ) ;
while ( CASES-- > 0 ) {
int N = reader.readInt ( ) ;
int M = reader.readInt ( ) ;
int [ ] v = new int [ N] ;
for ( int k = 0 ; k < N; k++ ) v[ k] = reader.readInt ( ) ;
solve( N, M, v) ;
}
//
out.close ( ) ;
}
void solve( int N, int M, int [ ] v) {
long lo = 0 , hi = 0 ;
for ( int k = 0 ; k < N; k++ ) {
hi += v[ k] ;
}
long ans = hi;
long sum = 0 ;
while ( lo <= hi ) {
long mid = ( lo + hi) >> 1 ;
int req = 1 ;
sum = 0 ;
for ( int k = 0 ; k < N; k++ ) {
if ( sum + v[ k] <= mid ) sum += v[ k] ;
else {
sum = v[ k] ;
req++;
}
}
if ( req <= M ) {
ans = mid;
hi = mid - 1 ;
} else lo = mid + 1 ;
}
// ans is max value
StringBuilder sb = new StringBuilder( ) ;
sb.append ( v[ N - 1 ] ) ;
sum = v[ N - 1 ] ;
M--;
for ( int k = N - 2 ; k >= 0 ; k-- ) {
if ( sum + v[ k] <= ans && k + 1 > M ) {
sb.insert ( 0 , " " ) ;
sum += v[ k] ;
} else {
sum = v[ k] ;
sb.insert ( 0 , " / " ) ;
M--;
}
sb.insert ( 0 , v[ k] ) ;
}
out.println ( sb) ;
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5hd3QuKjsKaW1wb3J0IGphdmEubWF0aC4qOwoKcHVibGljIGNsYXNzIE1haW4gaW1wbGVtZW50cyBSdW5uYWJsZSB7CgoJc3RhdGljIFByaW50V3JpdGVyIG91dCA9IG5ldyBQcmludFdyaXRlciggbmV3IEJ1ZmZlcmVkT3V0cHV0U3RyZWFtKFN5c3RlbS5vdXQpICk7CglwdWJsaWMgc3RhdGljIH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