Purchase requirements of Store B: (40 * 4+5x) * 0.9 = 4.5x+ 144.
When 5x+ 140 = 4.5x+ 144, that is, x = 8, you have to pay the same amount in both stores.
When 5x+ 140
When 5x+ 140 >: 4.5x+ 144, that is, x > at 8 o'clock, it is cost-effective.