Irreversible fight (breakup)

3 teams scored 235 points on this task, for a maximum score of 100, an average score of 78 and a median score of 100.

Highlights

  1. Magistri Cumacini, Como is the institute with the most points (100).
  2. Lombardia is the region with the most points (100).

Statement

After years of idyllic cooperation, Giorgio and William had a big fight on how to organize the final round of the OIS and eventually broke up, leaving the whole Italian Informatics Olympiads (OII) team shaken to the core. The OII team consists of N people, where 0 is William and N-1 is Giorgio. Among them, there are M directed friendship bonds, so that person A_i values friendship with B_i as V_i worth. As usual with breakups, everyone now needs to choose on which side they want to be: should they blame William or Giorgio? Of course, this choice is never done based on the actual facts happened. Instead, everyone chooses the side to which he is more bonded. More precisely, if S is a set of people and x is a person, the total bond B_S(x) of x to S is equal to the sum of values V_i of bonds between x and his friends in S. Every person chooses to support Giorgio or William trying to maximise the total bond with other people supporting the same person...