Inspired by a chat conversation I lurked.
I am an adventurer on the far away land of Zendikar. I truly enjoy traveling the land. Bushwhacking, weathering the roil and encountering strange and exotic flora and fauna are the highlights of any good adventure. Unfortunately, my duties as an adventurer do not always allow me to stop and smell the lotuses. Occasionally I am crunched for time and must hop on my kitesail and fly to my destination. I just glide over the land without being able to enjoy it.
The Challenge
Write a program that will let me know if I can choose not to fly. The program will take three inputs: my current location, my destination, and the maximum permitted travel time in days. Using the information below, determine if my travel time on foot is less than my maximum allowed travel time. If it is and I can travel on foot, return a truthy value. If the land travel time is as long as or longer than the maximum time, return a falsey value.
Guul Draz is two days away from Sejiri, its only neighboring territory.
Sejiri is one day away from Murasa and two days from Guul Draz.
Murasa is one day from Bala Ged, one day from Akoum, two days from Tazeem, and one day from Sejiri.
Bala Ged is two days from Akoum and one day from Murasa.
Akoum is one day from Ondu, one day from Murasa and two days from Bala Ged.
Ondu is one day from Akoum, its only neighboring territory.
Tazeem is two days from Murasa, its only neighboring territory.
Every location is connected, but not always directly. For example, going from Tazeem to anywhere requires you to travel to Murasa first. There are no real branches in the path either. Protip: Only go to Bala Ged if it is one of your endpoints. Here is a rough map if you're lost:
Bala Ged --
| \
Guul Draz ---- Sejiri -- Murasa -- Akoum -- Ondu
|
|
Tazeem
Scoring
This is code golf, so shortest program wins. Standard loopholes apply.
Test Cases
Guul Draz
Ondu
5
False
Bala Ged
Akoum
3
True
Tazeem
Sejiri
1
False