Skip to main content

Posts

Showing posts from January, 2021

Fair Elections January Challenge 2021 Division 3 FAIRELCT

Fair Elections  Problem Code:  FAIRELCT Elections are coming soon. This year, two candidates passed to the final stage. One candidate is John Jackson and his opponent is Jack Johnson. During the elections, everyone can vote for their favourite candidate, but no one can vote for both candidates. Then, packs of votes which went to the same candidate are formed. You know that for John Jackson, there are  N N  packs containing  A 1 , A 2 , … , A N A 1 , A 2 , … , A N  votes, and for Jack Johnson, there are  M M  packs containing  B 1 , B 2 , … , B M B 1 , B 2 , … , B M  votes. The winner is the candidate that has strictly more votes than the other candidate; if both have the same number of votes, there is no winner. You are a friend of John Jackson and you want to help him win. To do that, you may perform the following operation any number of times (including zero): choose two packs of votes that currently belong to different candidates and swap them, i.e. change the votes in each of these