Watermelons are sold every day: 40÷5x7=56 (pieces).
And the difference between selling 50 pieces a day: 56-50=6 (pieces)
Sold: 36÷6=6 (days)
Watermelon in fruit shop: 50x6+36=336 (each)