Description: A car ferry port, there are n vehicles to cross the river. n is either the car only two buses, either truck. Known across the river ferry can carry 10 cars each, starting from 0 to once every 10 minutes (ie, 0 a, 10 a, and so on). They know on the ferry to comply with the following requirements: if x points to a car ferry to the large ferry all the time <= x min and it could not cross the river on board the vehicle, and passenger vehicles on board prior to each on the 4 buses will be on a truck, then if there is no vehicle on the bus, if there is no passenger on the truck. Try to write a program to simulate the management of the ferry, bus and truck statistical average waiting time.
Input formats:
The first line of a positive integer n (1000 <= n <= 1000 000), said the total number of vehicles to cross the river.
The second line to the n 1 line per line two non-negative integer type, time (0 <= time <= 1000 000), said the time points to reach the ferry car is of ty
To Search:
File list (Check if you may need any files):
ferry.cpp