TopYodeller | 프로그래밍의 벗 PivotOJ
PivotOJ

TopYodeller

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2004 SeniorBOJ 6893

문제

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 the round. To keep the judge impartial, each yodeller is assigned a contestant number. Every yodeller competes in every yodel round. After all the yodel 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 (CCC) to write a program which 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 their score. Therefore, there may be multiple yodellers at the same rank.

입력

Each test case consists of one TopYodeller competition. The first line of the input contains two integers, nn and kk; nn (2n100)(2 \le n \le 100) represents the number of yodellers in the competition, and kk (1k100)(1 \le k \le 100) represents the number of yodel rounds in the competition.

Yodellers are assigned contestant numbers from 11 to nn.

Next in the input are kk lines, each line representing a yodel round.

Each line of input representing a yodel round contains nn integers. These nn integers give the scores assigned to the nn yodellers by the judge. The first integer corresponds to the score given to yodeller number 11, and so forth. The score assigned to a yodeller in any given round is an integer between 1000-1\,000 and 10001\,000, inclusive.

출력

For the highest-ranked yodeller 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 rank at any time during the competition. If there is a tie for TopYodeller, the output should be one line per winning contestant, listed by increasing competitor number.

힌트

After Round 1

  • Yodeller 3 has score 100, and is ranked 1.
  • Yodeller 1 has score 99, and is ranked 2.
  • Yodeller 2 has score 97, and is ranked 3.
  • Yodeller 4 has score 85, and is ranked 4.
  • Yodeller 5 has score -4, and is ranked 5.

After Round 2

  • Yodeller 5 has score 996, and is ranked 1.
  • Yodeller 3 has score 200, and is ranked 2.
  • Yodeller 1 has score 194, and is ranked 3.
  • Yodeller 2 has score 194, and is ranked 3.
  • Yodeller 4 has score 147, and is ranked 5.

예제

예제 1

입력
5 2
99 97 100 85 -4
95 97 100 62 1000
출력
Yodeller 5 is the TopYodeller: score 996, worst rank 5
코드를 제출하려면 로그인하세요.