Problem

Source: Tournament of Towns 2015 Junior A-Level Question 7

Tags: Tournament of Towns



Santa Clause had $n$ sorts of candies, $k$ candies of each sort. He distributed them at random between $k$ gift bags, $n$ candies per a bag and gave a bag to everyone of $k$ children at Christmas party. The children learned what they had in their bags and decided to trade. Two children trade one candy for one candy in case if each of them gets the candy of the sort which was absent in his/her bag. Prove that they can organize a sequence of trades so that finally every child would have candies of each sort.