You have A fruits, B vegetables and C fishes. You can make a single meal using 1 fruit and 1 vegetable or using 1 vegetable and 1 fish.
Determine if you can make at least N meals.
The number of meals that can be prepared can not exceed B, since each meal requires 1 vegetable (and there are only B vegetables).
Also, the number of meals can not exceed A+C, since each meal also requires either a fruit or a fish (and there are a total of A+C fruits and fishes).
Therefore, the number of meals that can be prepared is clearly the lower of the two constraints \implies \min (B, A+C).
YES if the value is \ge N and
per test case.
Editorialist’s solution can be found here.
Experimental: For evaluation purposes, please rate the editorial (1 being poor and 5 excellent)