for _ in range(int(input())): n,m=map(int,input().split()) a=list(map(int,input().split())) for i in range(n-1): if a[i]+a[i+1]