You have N coins, where N ≥ 5, and you know that exactly two of the coins are counterfeit and the rest are genuine. The genuine coins each weigh some amount w1 and the counterfeit coins each weigh some amount w2. You know for certain that w1 ≠ w2, but you do not know which is greater.
You have access to a balance that you are allowed to use up to four times. The balance has two trays, and one use consists of loading each of the trays with any coins of your choice, after which the balance tells you whether the contents of the left tray weigh more than, less than, or the same amount as the contents of the right tray.
Your goal is to determine which two coins are counterfeit, but you do not need to ascertain whether or not w1 > w2. What is the maximum value of N for which you can guarantee success, and what is the method of doing so?
Although these kinds of problems are common, I hunted around and have never seen this variation before. The wording of the problem is my own.