Approximately 200/60 = R customers enter per minute
Let's say that the average length of stay is x minutes.
At a given time T from 0 hours, approximately RT customers have entered.
Customer 0 has left by T if T > x.
Customer 1 has left by T if T - R > x
Customer n has left by T if T - nR > x
Let N be the smallest number such that T - NR > x. Then at time T, about N customers have left. Let's just say that T - NR = x, so that N = (T-x)/R.
Then there should be RT - N = RT - T/R + x/R customers in the shop at T.
Then (1/60) times the integral of this quantity from T = 180 to T = 240 represents the average number of customers in the shop during hour 3. This equals 45 by assumption, so solve for x in the resulting equation to get a value.
It won't be exact, but it's a pretty good approximation. To get an exact value, you need to use floor functions when calculating N.