Sum of Numbers
면접 대비시간 제한1초메모리 제한1024 MB
자릿수 문자열을 정확히 k개의 더하기 기호로 잘라 k+1개의 수를 만들고, 그 합이 최소가 되도록 자르는 위치를 정한다.
문제
Given digits from '1' to '9', you can add '+' to turn it into an expression. Find the minimum value of the expression.
입력
There are multiple test cases.
The first line of the input contains one integer () --- the number of test cases.
For each test case:
The first line contains two integers () and (, ) --- the number of digits and the number of '+'.
The second line contains a string of length , which consists of digits from '1' to '9'.
The sum of over all test cases does not exceed .
출력
For each test case, output the answer in one line.