include
include
include
include
include
define pb push_back
define mp make_pair
define xx first
define yy second
define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i++)
define dwn(i,a,b) for(int i=(a),i##end=(b);i>=i##end;i--)
using namespace std;
const int Size=1<<16;
char buffer[Size],head,tail;
inline char Getchar() {
if(head==tail) {
int l=fread(buffer,1,Size,stdin);
tail=(head=buffer)+l;
}
if(head==tail) return -1;
return *head++;
}
inline int read() {
int x=0,f=1;char c=getchar();
for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
for(;isdigit(c);c=getchar()) x=x10+c-'0';
return x*f;
}
typedef long long ll;
typedef pair<int,int> pii;
const int inf=1e9;
int f[2][1<<16][55],val[1<<16];
int n,m,a,b,A[110];
void FWT(int f) {
rep(j,0,a-1) rep(i,0,(1<<a)-1) if(i>>j&1) val[i]+=val[i^(1<<j)];
// rep(i,0,(1<<a)-1) printf("%d %d\n",i,val[i]);
}
int main() {
n=read();m=read();a=read();b=read();
rep(i,1,n) A[i]=read();
rep(i,1,b) {
int x=read(),y=read(),c=0;
rep(i,1,x) {
int p=read();
c|=1<<(a-p);
}
val[c]+=y;
}
FWT(val);
rep(i,0,(1<<a)-1) rep(j,0,m) f[0][i][j]=-inf;
f[0][0][0]=0;
int cur=0;
rep(i,1,n) {
cur^=1;
rep(S,0,(1<<a)-1) rep(j,0,m) f[cur][S][j]=-inf;
rep(S,0,(1<<a)-1) rep(j,0,m) {
int ans=f[cur^1][S][j];if(ans==-inf) continue;
// printf("%d %d %d %d\n",i-1,S,j,ans);
if(i<a) {
f[cur][S<<1][j]=max(f[cur][S<<1][j],ans);
f[cur][(S<<1)|1][j+1]=max(f[cur][(S<<1)|1][j+1],ans+A[i]);
}
else {
int nS=S<<1;if(nS>>a&1) nS^=(1<<a);
f[cur][nS][j]=max(f[cur][nS][j],ans+val[nS]);
f[cur][nS^1][j+1]=max(f[cur][nS^1][j+1],ans+A[i]+val[nS^1]);
}
}
}
int ans=-inf;
rep(i,0,(1<<a)-1) rep(j,0,m) ans=max(ans,f[cur][i][j]);
printf("%d\n",ans);
return 0;
}