Imagine you are in a city which has a considerable size. It is 5 pm, time to spend some time with friends; however, to meet them you need…