Nineright is manager of a shipping company. With only ONE ship at the beginning of his career, he had to carefully consider the trip to maximize his incoming. But unlike other vehicles, shipping costs much more time.
One day, Nineright comes to you for your help. He is so excited, and said:” help me! I have found the best way to do the business. I would consider the route as a circle that my ship could run every minute! What’s more, I find the route with the maximum average profit is the best. Now, I am going to get them together…”
What a nice idea! You’re going to help him, don’t you!
You are going to get the map as a directed graph. And from city i to city j, you would earn some money pij by do the business. It will cost you tij time to finish that. You are going to find the circle route with maximum average profit!