Problem

Source: 42nd International Tournament of Towns, Junior A-Level P2 & Senior A-Level P1, Spring 2021

Tags: combinatorics, invariant, Tournament of Towns



In a room there are several children and a pile of 1000 sweets. The children come to the pile one after another in some order. Upon reaching the pile each of them divides the current number of sweets in the pile by the number of children in the room, rounds the result if it is not integer, takes the resulting number of sweets from the pile and leaves the room. All the boys round upwards and all the girls round downwards. The process continues until everyone leaves the room. Prove that the total number of sweets received by the boys does not depend on the order in which the children reach the pile. Maxim Didin