Football Match

While the FIFA World Cup is being held in Qatar, BLGG is organizing a football tournament in LGU,

too.

There are n teams in this tournament, numbered from 1 to n. Each team has its popularity, and the

popularity of team i is ai . A match between i and j will gain ai × aj MOD M attractions.

When a football team loses a match, it will be eliminated from the tournament. At the end, the team

left standing will be the champion of this tournament.

BLGG is wondering that what the maximum sum of the attractions of the (n 1) matches.

Leave a Reply

Your email address will not be published. Required fields are marked *