Java Dividing Coins Solution