#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mode=1e9+7;
const int maxn=(1<<17)+5;
ll dp[maxn<<1],*pre,*cur;//分别从前往后,从后往前
int t,n,m;
int main()
{
int s;
cin>>t;
while(t--)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mode=1e9+7;
const int maxn=(1<<17)+5;
ll dp[maxn<<1],*pre,*cur;//分别从前往后,从后往前
int t,n,m;
int main()
{
int s;
cin>>t;
while(t--)