Playing With Stones

Kolu was playing with $N$ piles of stones. His target is to make all piles equal within $M$ moves, possibly zero.


This is a companion discussion topic for the original entry at https://toph.co/p/playing-with-stones