Coins
How will you solve the riddle, claim the treasure and escape the dungeon?
You are a pirate. Some time ago, you found a map leading to a treasure, and you’ve just arrived at the spot marked with an X. While exploring the area, you discover the entrance to a hidden dungeon. You walk through its corridors and finally find the treasure.

It consists of piles of precious coins, gold on one side and silver on the other. They are stacked in columns and flipped randomly – either the silver or gold side facing up.
But the moment you step into the treasure chamber, the door slams shut behind you. The ghost of the nobleman who hid the treasure appears. He demands that you prove you are worthy of such wealth by solving his riddle. Fail, and you will be trapped in the dungeon forever.

The riddle requires you to divide the coins into two piles, such that each pile has the same number of coins showing the silver side up. The piles can have a different number of coins. What matters is that the number of coins with the silver side facing up is the same in both piles.
After explaining the riddle, the ghost blows out your torch. Now it's impossible to see which side of the coins is facing up. You also can't feel any difference when touching them. You don’t remember where the silver-side-up coins were in the piles. However, you do remember that there were exactly twenty coins showing the silver side up.
How will you solve the riddle, claim the treasure and escape the dungeon?