FromToDivisible Solves the TopCoder problem FromToDivisible. Finds the shortest path between two nodes via breath first search while complying with constraints.