There is a large, circular, one-way road, driven on by a number of evenly spaced buses, with an equal number of evenly spaced bus stations placed next to it.
Each bus and station belongs to one of
Note that a bus can visit the same station multiple times.
Constraints
Subtask 1 [10%]
Subtask 2 [90%]
No additional constraints.
Input Specification
The first line contains two integers,
The second line contains
Output Specification
Output a single line containing an integer, the maximum number of times buses will visit a station.
Sample Input
2 3
2 2
Sample Output
8
Explanation for Sample
We can place buses and stops like this (the first row is the stops, and the second row is the buses):
2 2 1 1
1 1 2 2
Since
At time
2 2 1 1
2 1 1 2
At time
2 2 1 1
2 2 1 1
At time
2 2 1 1
1 2 2 1
Comments