You are given a sequence A of N positive integers. Split the sequence into exactly K blocks. A block is a non-empty run of consecutive elements, and every element belongs to exactly one block.
The value of a split is the sum of the largest element of each of the K blocks. For the given K, find the smallest value a split can have.
Input
The first line contains two integers N and K (1≤K≤N≤2000).
The second line contains N integers A1,A2,…,AN (1≤Ai≤106), the elements of the sequence.
Output
Print one integer, the smallest possible value of a split into K blocks.