Under construction

Still being built. Things may change

TopYodeller

Interview

Time limit1sMemory limit128 MB

Summary
Compute each yodeller's cumulative score after every round, find who ends with the highest total, and report their worst rank.
Level

Easy3 of 10

Topics
Array, Simulation, Sorting
Solved
No attempts yet

Problem

A yodel is a wordless song that shifts suddenly from a normal voice to a high, falsetto voice and back. Yodeling, present in many Swiss folk songs, is commonly heard throughout the Alps.

The TopYodeller contest invites the world's best yodellers to compete for a share of 100,000 Swiss Francs, with the best yodeller receiving 50,000 Francs. Each yodeller competes in a series of yodel rounds and is assigned a score by the judge for their performance in each round. To keep the judge impartial, each yodeller is assigned a contestant number. Every yodeller competes in every round. After all the rounds are complete, the yodeller with the highest total score is declared the TopYodeller.

You have been hired by the TopYodeller Contest Co-ordinating Committee to write a program that generates a scoreboard so that yodel fans around the world can track the progress of the best yodellers on the Internet.

After each round, each yodeller's cumulative score is calculated and a rank is assigned. A yodeller's rank is j+1j+1 if jj yodellers have a cumulative score higher than theirs. Therefore, there may be multiple yodellers at the same rank.

Input

The input describes one TopYodeller competition. The first line contains two integers nn and kk: nn (2≤n≤100)(2 \le n \le 100) is the number of yodellers, and kk (1≤k≤100)(1 \le k \le 100) is the number of rounds.

Yodellers are assigned contestant numbers from 11 to nn.

The next kk lines each represent one round. Each such line contains nn integers giving the scores the judge assigned to the nn yodellers: the first integer is the score of yodeller 11, the second is the score of yodeller 22, and so on. Each score is an integer between −1000-1000 and 10001000, inclusive.

Output

For the highest-ranked yodeller (the one with the highest total score) at the end of the competition, output:

Yodeller x is the TopYodeller: score y, worst rank z

where xx is the contestant number, yy is their total score after the competition, and zz is their worst (largest) rank at any time during the competition. If there is a tie for TopYodeller, output one line per winning contestant, in increasing order of contestant number.

Hint

For the example above, the ranks change as follows.

After Round 1

  • Yodeller 33 has score 100100 and is ranked 11.
  • Yodeller 11 has score 9999 and is ranked 22.
  • Yodeller 22 has score 9797 and is ranked 33.
  • Yodeller 44 has score 8585 and is ranked 44.
  • Yodeller 55 has score −4-4 and is ranked 55.

After Round 2

  • Yodeller 55 has score 996996 and is ranked 11.
  • Yodeller 33 has score 200200 and is ranked 22.
  • Yodeller 11 has score 194194 and is ranked 33.
  • Yodeller 22 has score 194194 and is ranked 33.
  • Yodeller 44 has score 147147 and is ranked 55.

Yodeller 55 has the highest final total, so they are the TopYodeller; their worst rank during the competition was 55th, in Round 1.

Examples2

  1. Example 1

    Input
    5 2
    99 97 100 85 -4
    95 97 100 62 1000
    
    Expected output
    Yodeller 5 is the TopYodeller: score 996, worst rank 5
    
  2. Example 2

    Input
    2 1
    5 5
    
    Expected output
    Yodeller 1 is the TopYodeller: score 5, worst rank 1
    Yodeller 2 is the TopYodeller: score 5, worst rank 1