#C3147. Auction Winners

    ID: 46542 Type: Default 1000ms 256MiB

Auction Winners

Auction Winners

In this problem, you are given an auction scenario with multiple items. For each item, several participants place their bids. The winner for an item is the participant with the highest bid. In the event of a tie, the participant with the smallest index (0-based) wins.

Formally, for each item with bids b0,b1,,bn1b_0, b_1, \dots, b_{n-1}, the winning index is given by $$\min{ i \mid b_i = \max{b_0, b_1, \dots, b_{n-1}} }.$$

inputFormat

The first line of input contains an integer TT, the number of auction items. Each of the following TT lines describes one item. Each such line begins with an integer NN, the number of bids for that item, followed by NN space-separated integers representing the bids.

outputFormat

Output a single line containing TT integers separated by a space. The ii-th integer represents the index (0-based) of the winning participant for the ii-th item.## sample

1
1 10
0

</p>