#K80437. Marathon Winner Determination
Marathon Winner Determination
Marathon Winner Determination
You are given a list of participants in a marathon. Each participant is represented by a pair of integers: a participant number and their completion time. Your task is to determine the winner of the marathon. The winner is defined as the participant with the minimum completion time. In case multiple participants have the same completion time, the participant with the smallest number is chosen.
Formally, if each participant is represented as \( (id, t) \), then the winner \( (id^*, t^*) \) satisfies:
\( t^* = \min\{t_i\} \) and if \( t_i = t^* \) for more than one \( i \), then \( id^* = \min\{id_i \mid t_i = t^*\} \).
inputFormat
The input is provided via stdin and has the following format:
n id1 t1 id2 t2 ... idn tn
Where:
n
is the number of participants.- Each of the next
n
lines contains two integers: the participant number and the completion time.
outputFormat
The output should be written to stdout and consist of two integers separated by a space: the participant number and the completion time of the winner.
## sample1
1 100
1 100