Problem Jurassic Park

This problem code is NI01
Problem Link NI01 Problem - CodeChef
I can’t figure out a way to count the number of cars which will be available after each time frame of safari riding?

please help…