#K63817. Prize Distribution Problem

    ID: 31838 Type: Default 1000ms 256MiB

Prize Distribution Problem

Prize Distribution Problem

You are given two lists of integers. The first list represents the scores of participants, and the second list represents the available prizes. Your task is to assign each participant a prize such that the participant with the highest score receives the best (largest) prize, the second highest score receives the second best prize, and so on. In case of equal scores, maintain the order of appearance when assigning prizes.

Note: The output should display the resulting pairs in descending order of scores. Each pair consists of the participant's score and the prize they receive.

Input/Output: The input is read from standard input and the output is written to standard output.

inputFormat

The first line contains an integer n representing the number of participants. The second line contains n space-separated integers denoting the scores of the participants. The third line contains n space-separated integers representing the prizes available.

outputFormat

Output n lines. Each line contains two integers separated by a space: the score of a participant and the prize assigned to them, in descending order of scores.

## sample
3
10 20 30
300 200 100
30 300

20 200 10 100

</p>