22791_SoccerBets

2022-5-16 18:22| 发布者: Hocassian| 查看: 21| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506961660900-Problem List-采集的数据-后羿采集器.html

Pro.ID

22791

Title

Soccer Bets

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22791

AC

12

Submit

15

Ratio

80.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    The teams have finished the group stage of the FIFA World Cup and the teams that are in the round of the last sixteen are known. My boss has all of the game sanalyzed and bet on the whole rest of the tournament -- writing the outcome of each match on a single sheet of paper. It was my job to bring his bets to the next betting office and set 1000$. Being nervous with so much cash in my pockets I fell over (I am a bit clumsy) and the bets got shuffled. So I don't know if a bet corresponds to the final match or the semi-final or something else.

    I do not want to disappoint my boss, so I decided to place only one bet on the winner of the tournament. Everything I know is that in each round the teams that win (a team wins if it shoots more goals than the opposing team) are in the next round, the other teams are eliminated from the tournament. This is not true for the semi-finals where the losers also play for the third place. So we have in total 16 matches.

    Can you please tell me which team will win the World Cup based on the bets of my boss?

    输入

    The first line of the input is the number of test cases c (1 ≤ c ≤ 100). Each test case consists of 16 lines describing the matches in random order. A match description looks as follows: t1  t2  g1  g2.  t1 and t2 are the names of teams (abbreviated as exactly three uppercase letters), g1 and g2 ( 0 ≤ g1, g2 ≤ 10 ;  g1g2 ) are the goals of the two teams.

    输出

    Description

    The teams have finished the group stage of the FIFA World Cup and the teams that are in the round of the last sixteen are known. My boss has all of the game sanalyzed and bet on the whole rest of the tournament -- writing the outcome of each match on a single sheet of paper. It was my job to bring his bets to the next betting office and set 1000$. Being nervous with so much cash in my pockets I fell over (I am a bit clumsy) and the bets got shuffled. So I don't know if a bet corresponds to the final match or the semi-final or something else.

    I do not want to disappoint my boss, so I decided to place only one bet on the winner of the tournament. Everything I know is that in each round the teams that win (a team wins if it shoots more goals than the opposing team) are in the next round, the other teams are eliminated from the tournament. This is not true for the semi-finals where the losers also play for the third place. So we have in total 16 matches.

    Can you please tell me which team will win the World Cup based on the bets of my boss?

    Input

    The first line of the input is the number of test cases c (1 ≤ c ≤ 100). Each test case consists of 16 lines describing the matches in random order. A match description looks as follows: t1  t2  g1  g2.  t1 and t2 are the names of teams (abbreviated as exactly three uppercase letters), g1 and g2 ( 0 ≤ g1, g2 ≤ 10 ;  g1g2 ) are the goals of the two teams.

    Output

    For each test case, print one line containing the team that will win the FIFA World Cup (based on the analysis of my boss which is always correct!).

    Sample Input

    1
    ITA URU 2 0
    ITA IRE 1 0
    ITA ARG 3 4
    YUG ARG 2 3
    GER CZE 1 0
    ENG GER 3 4
    ITA ENG 2 1
    CAM COL 2 1
    ENG CAM 3 2
    ENG BEL 1 0
    GER ARG 1 0
    CZE CRC 4 1
    NET GER 1 2
    BRZ ARG 0 1
    SPA YUG 1 2
    ROM IRE 4 5

    Sample Output

    GER

    Source

    样例输入

    1
    ITA URU 2 0
    ITA IRE 1 0
    ITA ARG 3 4
    YUG ARG 2 3
    GER CZE 1 0
    ENG GER 3 4
    ITA ENG 2 1
    CAM COL 2 1
    ENG CAM 3 2
    ENG BEL 1 0
    GER ARG 1 0
    CZE CRC 4 1
    NET GER 1 2
    BRZ ARG 0 1
    SPA YUG 1 2
    ROM IRE 4 5

    样例输出

    GER

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部