URAL 1728. Curse on Team.GOV(STL set)

An ICPC subregional contest is approaching, and the organizing committee obliged Lyosha and Vadik to find the third member of the team. Lyosha and Vadik compiled a list of candidates and calculated the rating of each candidate according to a secret formula. The power of the team is equal to the sum of the ratings of its members. Lyosha and Vadik want their team to be as powerful as possible. But the team is cursed… As the fates decree, if the team composition repeats a composition that once participated in some contest, Lyosha won’t be able to come to the contest (and the power of the team will decrease by his rating). Even in this case, if this team composition (without Lyosha) participated in some contest earlier, Team.GOV will suddenly be disqualified during the practice session and won’t take part in the contest. Help the permanent members of Team.GOV choose the third member so that the team will be as powerful as possible in the subregional contest.

,因为在路上你就已经收获了自由自在的好心情。

URAL 1728. Curse on Team.GOV(STL set)

相关文章:

你感兴趣的文章:

标签云: