描述:
There are NN prisoners in jail cells numbered from 00 to N−1N−1 and GG guards. The guards ensure the prisoners do not escape and can only take charge of adjacent segments of jail cells. Each jail cell is assigned to exactly one guard.
Each prisoner ii has a certain intelligence SiSi, and if the guard is watching him has kk people to watch over, his escaping possibility will be kSikSi. You should assign the guards so that the total escaping possibility over all the prisoners is minimized.
输入:
The first line of input contains 22 integers NN and GG (1≤8000≤N,1≤3000≤G1≤8000≤N,1≤3000≤G).
The next NN lines of input will contain one integer each, SiSi (1≤Si≤1091≤Si≤109).
输出:
The output should contain one line with one integer, the minimum total escaping possibility.
翻译:监狱牢房里有n个编号为0到n-1的囚犯还有g个守卫.守卫只能负责相邻的牢房并且需要确保囚犯无法逃跑.每个牢房有一个守卫.每个囚犯i有智商si,如果守卫需要看管k个囚犯,那么囚犯逃跑的概率为ksi.你应该分配守卫以保证囚犯最小的逃跑概率.
输入:第一行输入2个整数n和g)1<=8000<=n.1<=3000<=g.
接下来n行输入一个整数si(1<=si<=10E9).
输出:输出中一行一个整数,该整数为逃跑的总概率.