Pocky is a sweet snack food, a biscuit stick that is very delicious!
As we are a CS students, our Pocky is described by 1D array with length N blocks. The pocky could be eaten from the most left or most right.
Also since 福昌 is a light eater, he won't eat all of the pocky, as he only can eat K blocks, however he want the maximum value from eating K blocks
For example given the Pocky array:
If the K = 3, The maximum value can be gathered from eating from the right block three times, as total value = 1 + 15 + 2 = 18
If the K = 5, The maximum value could be get by eating 2 block from the right side, and then 3 block from the left side, as total value = 1 + 15 + 1 + 7 + 8 = 32
Your task is to calculate the maximum value from given Pocky array and K.
There are T testcases
Each testcase has
1 <= T <= 50
1 <= K <= N <= 50000
1 <= ai <= 109
print the maximum value followed by newline character for each testcase