Company: Wells frago_10march
Difficulty: medium
1. Bus Fare Minimization Problem In a city, a bus stops every kilometer. Also, the bus fare is different from 1km to 10km, so you can use each section well to decrease the total fare to get to the destination. For example, let's suppose a bus fare list as below: 12 21 31 40 49 58 69 79 90 101 According to the list, the minimum fare would be 147 for 15km: → 1 ticket for 3km + 2 tickets for 6km. When the bus fare and distance are given, calculate the minimum fare that you can move the given distance. Input: First line: 10 integers, the bus fare from 1km to 10km. Second line: The distance to move, N. (1 ≤ N ≤ 10000) Output: The minimum fare to travel the distance. Example: Input: 12 21 31 40 49 58 69 79 90 101 15 Output: 147 2. Farmer’s Shortest Path Problem The farmer wants to return home, Farm No. 1, from Farm No. N. The farmer is very tired and wants to return home as fast as possible. In the farms he cultivates, there are T two-way roads. Create a program that helps t