Subnumber Sum

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Let's solve this simple problem.

Given a positive integer, we can make a new number by taking some digits from the given number and concatenating them without changing the order. Let's call it a subnumber of a given number. For example, we can take 3,1,13, 1, 1 from 3141531415 to make a subnumber 311311.

A positive integer of NN digits is given. You can make two subnumbers by selecting KK digits to make one and the remaining NKN-K digits to make the other. Given the number of digits KK that you have to select, find the maximum sum of two subnumbers. It is allowed for a subnumber to have leading zeros.

입력

The first line contains the number of test cases TT (1T10,000)(1 \leq T \leq 10,000)

For each test case, the first line contains two integers N,KN, K (2N18,1K<N)(2 \leq N \leq 18, 1 \leq K < N) and the second line contains a positive integer of NN digits. The input number has no leading zeros, although its subnumbers can.

출력

For each test case, output the maximum sum of two subnumbers satisfying the conditions in one line.