k guests will have Uyghur Polo in Wowo's house around a big round table.n≥k) chairs are placed around the table uniformly. Each guest sits on a chair and no two guests sit on the same chair.k bowls of Uyghur Polo are on the table. Each bowl is next to some chair . No two bowls locate at the same position.As a waiter, you are supposed to assign each person with exactly one bowl of Uyghur Polo. The table can be rotated, so each time you can turn it. degrees clockwise or counterclockwise. The bowls turn with the table while the chairs and guests do not move. When one bowl of Uyghur Polo is in front of a guest, he can either take it or wait for another.You want to minimize the total times of table rotating so that everybody can have meals as quickly as possible.(Formal definition: The boundary of the table is a circle.n points on the circle whose convex hull is a regular polygon with
Wowo is a hospitable Xinjiang uncle.
{k}
k guests will have Uyghur Polo (a traditional Uyghur food) in Wowo's house around a big round table.
{n}
n (
nge k
n≥k) chairs are placed around the table uniformly. Each guest sits on a chair and no two guests sit on the same chair.
{k}
k bowls of Uyghur Polo are on the table. Each bowl is next to some chair (with or without some guest sitting on it). No two bowls locate at the same position.
As a waiter, you are supposed to assign each person with exactly one bowl of Uyghur Polo. The table can be rotated, so each time you can turn it
frac{2pi}{n}
n
2π
degrees clockwise or counterclockwise. The bowls turn with the table while the chairs and guests do not move. When one bowl of Uyghur Polo is in front of a guest, he can either take it or wait for another.
You want to minimize the total times of table rotating so that everybody can have meals as quickly as possible.
(Formal definition: The boundary of the table is a circle.
{n}
n chairs are at
{n}
n points on the circle whose convex hull is a regular polygon with
{n}
n vertices. We name the points
0,ldots, n-1
0,…,n−1 in counterclockwise order. The
{i}
i-th bowl is at point
b_i
b
i
(
0le b_i