You need to use the equation that relates frequency and period; period = 1/frequency
Then all you need to do is plug in the frequency to get the periodic time:
Two trains move towards one another. The first one has a speed of 30 km/h, and the second one travels at 50 km/h. The initial distance between them is 160 km