Alice is a lead singer in a band. Her band is on a tour, holding concerts every month. However, they don't want to stay in the same city for two consecutive months. Therefore, at the end of each month, the band will move to a city adjacent to the current one. There are a total of

cities, connected by

roads, and holding a concert in the

-th city for a month can generate revenue of

.
Alice's home is in the first city, so the band will hold the first concert there. The concert tour lasts for

months in total, and Alice wants to return to the first city for the final concert in the

-th month. In other words, in the

-th month, Alice must be in the first city.
Now, Alice wants to know how much revenue she can maximize during the

months.