#include <bits/stdc++.h>
using namespace std;
long long num[3000006], cu[3000006];
int main() {
  long long i, j, k, s, l, r, tc, test, n, m, d;
  cin >> test;
  for (tc = 1; tc <= test; tc++) {
    cin >> n >> m >> k;
    for (i = 1; i <= n; i++) cin >> num[i];
    s = num[1];
    cu[1] = num[1];
    for (i = 2; i <= n; i++) cu[i] = cu[i - 1] + num[i];
    for (i = 2; i <= n && i <= m + 1; i++) {
      d = num[i] + num[i - 1];
      r = min(k * 2, m - i + 1);
      long long sum = (r / 2) * d;
      if (r % 2) sum += num[i - 1];
      sum += cu[m - r + 1];
      s = max(s, sum);
    }
    cout << s << endl;
  }
}
