Difficulty: Easy
Correct Answer: 4
Explanation:
Given data
Concept/Approach
Let p be pineapples and w be watermelons (integers ≥ 0). Solve the linear Diophantine equation: 7p + 5w = 38.
Step-by-step calculation
Reduce mod 5: 7p ≡ 38 (mod 5) ⇒ 2p ≡ 3 (mod 5) ⇒ p ≡ 4 (mod 5).Smallest feasible p = 4. Then cost from pineapples = 4 × 7 = 28.Remaining for watermelons = 38 − 28 = 10 ⇒ w = 10 / 5 = 2 (valid integer).
Verification
7(4) + 5(2) = 28 + 10 = 38 (matches total).
Final Answer
4
Discussion & Comments