#include #include #include using namespace std; int main(void) { // input int L,M,N,Q,ret; ret=scanf("%d%d%d",&L,&M,&N); assert(ret==3&&L>0&&M>0&&N>0&&L<=N&&M<=N); int *abp = (int*)malloc(sizeof(int)*(L+M)); assert(abp); for ( int i=0; i=1&&*tp<=N); } int *A=&abp[0], *B=&abp[L]; ret=scanf("%d",&Q); assert(ret&&Q>=1&&Q<=N); // solve int *R = (int*)calloc(Q,sizeof(int)); assert(R); for ( int i=0; i=0 && v