Solution to Pirate's Coin Sharing Problem