1. A puts amulet in the safe, puts lock on it, sends to B. B puts lock on it, sends back to A. A unlocks his lock and sends it back to B. B unlocks and receives the amulet.
2. Take 20 coins aside, and flip them - this is one group. Take the 80 remaining coins - this is the second group. If there were X (0 \leq X \leq 20) queens in the first group, then there were 20-X queens in the second group. Since we flip the 20 coins in the first group, there are now 20-X queens in the first group as well.