InterviewSolution
Saved Bookmarks
| 1. |
A has 2 coins and B has n coins. B wants to buy some pencils, which come in two different packages. One package of pencils costs 6 coins for 7 pencils, and the other package of pencils costs 10 coins for 12 pencils. B notes that he can spend all n of his coins on some combination of pencil packages to get p pencils. However, if A gives his two coins to B, he then notes that he can instead spend n+2 of his coins on some combination of pencil packages to get fewer than p pencils. The smallest value of n for which this is possible, is equal to |
|
Answer» A has 2 coins and B has n coins. B wants to buy some pencils, which come in two different packages. One package of pencils costs 6 coins for 7 pencils, and the other package of pencils costs 10 coins for 12 pencils. B notes that he can spend all n of his coins on some combination of pencil packages to get p pencils. However, if A gives his two coins to B, he then notes that he can instead spend n+2 of his coins on some combination of pencil packages to get fewer than p pencils. The smallest value of n for which this is possible, is equal to |
|