All submissions for this problem are available.
The Jacklosky water theme park is well known for its speed boat rides. The water park is always at its prime with large number of tourists visiting the park every day. There is a small museum showcasing the water animals and . There is a small island in between the park that locates the old Church built during the BC’s . It is possible to reach there only through boats. On a very special day, all the ordinary boats were on strike and only speed boats were available. The load on speed boat was increased drastically as it was the peak period of summer.
Let us suppose that each speedboat can carry only one tourist at a time and there are N speed boats available. When the speed boat is available, then it loads one tourist and unloads him on the island. The tourist then wanders around the island and returns back in the same speed boat. The speed boat has to wait for the tourist until he wanders around the island. Let us assume that it takes some T amount of time for the speed boat for the whole trip. If all the speed boats are gone for the ride then the tourist has to wait for the speed boat to arrive. If the theme park is open for X units of time per day and assuming that a tourist boards a speed boat after every K units of time.
Find the number of tourists that have completed the ride, the tourists that are waiting, the speed boats waiting for the tourists.
1. The number of test cases 2. The total number of speed boats, N 3. The number of tourists that are in the museum at start, P 4. The number of tourists that waiting in the queue for speed boat at the start, Q 5. The time for a ride, T 6. The time interval, K 7. The time for which theme park is open, X
0 < N <= 50 0 < P <= 5000 0 < Q <= 100 0 < T <= 100 0 < K <= 100 100 <= X <= 10000
All the inputs must be positive integers.
1. Number of speedboats that are waiting 2. Number of tourists who have taken the ride 3. Number of tourists waiting for the ride 4. Number of tourists still inside the museum
Input: 3 3 20 5 3 1 10 2 30 3 3 4 14 4 15 6 5 2 18 Output: 0 9 10 3 1 5 27 0 1 12 6 0
|Time Limit:||20 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, GO, PERL, PERL6, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.