Sunday, August 21, 2011

UVa 11300 - Spreading the Wealth

Problem link: http://uva.onlinejudge.org/external/113/11300.html

Problem in short -
Given n people sitting on a circular table, each with some number of coins, you have to redistribute the coins in a manner so that everyone has equal number of coins. Any person can only pass coins to his left or right. Calculate the minimum number of coins that need to be transferred.