The combined cost of the bananas, bread, and milk was 12 + 9 + 7 = $<<12+9+7=28>>28.
The difference between this and the total is the cost of the apples, which must have therefore cost Olivia 42 – 28 = $<<42-28=14>>14.
#### 14