#K71357. Fastest Checkpoint Times

    ID: 33513 Type: Default 1000ms 256MiB

Fastest Checkpoint Times

Fastest Checkpoint Times

You are given a series of test cases. In each test case, there are $N$ friends and $M$ checkpoints. Each friend records the time it took to reach each checkpoint. Your task is to determine the fastest (minimum) time at which each checkpoint was reached among all friends.

The input format begins with an integer indicating the number of test cases. For each test case, the first line contains two integers, $N$ and $M$. This is followed by $N$ lines, each containing $M$ integers that represent the time taken by a friend to pass through the checkpoints.

The output should list the fastest time for each checkpoint, in order, for every test case, with each test case's answer printed on a new line.

Example:

Input:
1
3 4
5 6 7 8
3 4 5 6
8 7 6 5

Output: 3 4 5 5

</p>

inputFormat

The first line of input contains an integer TT, the number of test cases. For each test case, the first line contains two integers NN and MM separated by a space. Then follow NN lines, each containing MM integers representing the time each friend took to reach each checkpoint.

outputFormat

For every test case, output a single line containing MM space-separated integers where each integer is the fastest time that checkpoint was reached.## sample

1
3 4
5 6 7 8
3 4 5 6
8 7 6 5
3 4 5 5

</p>