Train lines and cities

Problem Name:
Train lines and cities
Site:HackerEarth
Links:
Tags:
Problem setters: