Explanation:
The main floor has 24*20 = 480 seats.
So you need 786- 480 = 306 more seats
There are 17 rows in the balcony and let's say there are x seats in each row. Since you need 323 seats, this means
19x = 323
x = 306/17
x = 18
So there must be 18 seats in each row up in the balcony.