5. There are 40 visually identical coins, among which 3 are counterfeit - they weigh the same and are lighter than the genuine ones (the genuine coins also weigh the same). How can you use three weighings on a balance scale without weights to select 16 genuine coins?
5. First solution: Divide all the coins into two parts of 20 coins each and weigh them. Since the number of counterfeit coins is odd, one of the piles will weigh more. This means that there is no more than one counterfeit coin in it. Divide it into two piles of 10 coins and weigh them. If the scales are in balance, then all 20 weighed coins are genuine. If one of the pans outweighs, then there are 10 genuine coins on that pan, and among the other 10 coins, there is exactly one counterfeit. Divide these 10 coins into three piles of 4, 4, and 2 coins. In the third weighing, compare the two piles of 4 coins. If they balance, then all 8 coins are genuine, and we have found 18 genuine coins. If one of the piles outweighs, then there are 4 genuine coins in it, the other pile contains the counterfeit coin, and the 2 set aside coins are genuine.

Second solution: Divide all the coins into five equal piles, each containing 8 coins, and number them. Place the 1st and 2nd piles on one pan of the scales, and the 3rd and 4th on the other. Consider the first case - the scales balance. Then either there is one counterfeit coin on each pan, or all the coins in the weighing are genuine. Then take and weigh the 1st and 2nd piles. If they balance, then all 16 coins are genuine. If one of the piles outweighs, then there are 8 genuine coins in it. In the third weighing, compare the 3rd and 4th piles and determine the next 8 genuine coins. Now consider the second case - the scales do not balance. Let's assume for definiteness that the 1st and 2nd piles outweigh, then there is no more than one counterfeit coin among them. In the second weighing, compare the 1st and 2nd piles. If they balance, then all 16 coins are genuine. If one of the piles outweighs, then there are 8 genuine coins in it, and exactly one counterfeit in the other. Consequently, there are exactly two counterfeit coins in the 3rd and 4th piles, and 8 genuine coins in the 5th pile. Thus, a total of 16 genuine coins have been found.