#include #include #include #include using namespace std; bool found(const int* a,const int* b,int n){ for(int i=0;i> m; int d[m]; for(int i = 0; i < m; i++) { fin >> d[i]; } fin >> n; int a[n]; int b[n]; for(int i = 0; i < n; i++) { fin >> a[i]; b[i]=-1; } for(int i=1;i<1000000;i++){ shift(b,n); b[n-1]=tsuck(i,d,m); if(found(a,b,n)) { fout<