Since the kingdom is circular, we start from a person who has the highest money and move all the day across the circle and finish before the person we have started with. Think about for a second about how this solution will always work. A few hint for you to get going:

  1. A person may need to donate both to his right or left. How would he do that?
  2. If we can simplify our thought by imagine a situation that all of the people with excess money will only give to his right, what will happen?
  3. If it is possible to distribute the amount without the constraints, will this information be sufficient to distribute between all the individuals with the constraints?

Have fun!

Statistics

85% Solution Ratio
aomine23Earliest, Feb '21
nusuBotFastest, 0.0s
ABID_JAWADLightest, 131 kB
Jewel.SamaCShortest, 83B
Toph uses cookies. By continuing you agree to our Cookie Policy.