#include#include using namespace std;int s[1000010], p[10010];int next[10010];int m, n, ans, t;void getnext(){ int i, j; next[1]=0; j=0; i=1; while(i m) return i-m; else return -1;}int main(){ //freopen("in", "r", stdin); //freopen("out", "w", stdout); cin>>t; while(t--){ scanf("%d %d", &n, &m); for(int i=1; i<=n; i++){ scanf("%d", &s[i]); } for(int i=1; i<=m; i++){ scanf("%d", &p[i]); } getnext(); ans=kmp(); cout< <