#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define FORD(i,a,b) for(int i=(a);i>=(b);--i)
#define PB push_back
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
// const ll INF = 0x3f3f3f3f3f3f3f3fLL;
const int INF = 0x3f3f3f3f;
const int mxN = 1e5+1;
ll t, n, k, z, a[mxN], s[mxN];
int main() {
ios::sync_with_stdio(false);
cin>>t;
s[0]=0;
while(t--){
cin>>n>>k>>z;
REP(i, n){
cin>>a[i+1];
s[i+1]=s[i]+a[i+1];
}
ll mx=s[k+1];
FOR(i, 2, k){
ll cur=s[i], r=k-i+1; //r=moves remaining, took i-1 moves to reach i
int c=min(z, r/2); //maximum number of left moves we can make
FOR(j, 0, c){
cur+=(a[i]+a[i-1])*j;
r-=2*j;
mx=max(mx, cur+(s[i+r]-s[i]));
if(z-j){
mx=max(mx, cur+(s[i+r-1]-s[i])+a[i+r-2]);
}
r+=2*j;
cur-=(a[i]+a[i-1])*j;
}
if(r-2*c && z-c){ //we might be able to make one last left move
mx=max(mx, cur+a[i-1]);
}
}
cout<<mx<<'\n';
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdXNpbmcgbmFtZXNwYWNlIF9fZ251X3BiZHM7CiNkZWZpbmUgUkVQKGksbikgZm9yKGludCBpPTA7aTwobik7KytpKQojZGVmaW5lIEZPUihpLGEsYikgZm9yKGludCBpPShhKTtpPD0oYik7KytpKQojZGVmaW5lIEZPUkQoaSxhLGIpIGZvcihpbnQgaT0oYSk7aT49KGIpOy0taSkKI2RlZmluZ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