# Wasserstein Distance

// #include<bits/stdc++.h>
#include<algorithm>
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
const  int N = 1e5+1;
long long a[N],b[N];
int main()
{
// freopen("in.txt","r",stdin);
int t,n;
cin>>t;
while(t--)
{
memset(a,0,sizeof a);
memset(b,0,sizeof b);
scanf("%d",&n);
for(int i = 1; i <= n; ++i){
scanf("%lld",&a[i]);
a[i] += a[i-1];
}
for(int j = 1; j <= n; ++j){
scanf("%lld",&b[j]);
b[j] += b[j-1];
}
long long sum = 0;
for(int i = 1; i <= n; ++i){
sum += fabs(a[i]-b[i]);
}
printf("%lld\n",sum);
}
return 0;
}


# 小Y吃苹果

// #include<bits/stdc++.h>
#include<algorithm>
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
const  int N = 1e5+1;
int main()
{
// freopen("in.txt","r",stdin);
int t,n;
cin>>t;
cout<<(1<<t)<<endl;
return 0;
}


# 1 + 2 = 3?

#include<algorithm>
#include<iostream>
#include<stdio.h>
using namespace std;
const  int N = 60;
long long fib[N],two[N];
int main()
{
fib[0] = 1,fib[1] = 2, two[0] = 1;
// freopen("in.txt","r",stdin);
for(int i = 2; i < N; ++i){
fib[i] = fib[i-1]+fib[i-2];
}
for(int i = 1; i < N; ++i){
two[i] = two[i-1]*2;
}
int t;
cin>>t;
while(t--)
{
long long n;
scanf("%lld",&n);
long long sum = 0;
//至于为什么从58开始，是因为从第58项开始斐波那契数就已经大于1e12了
for(int i = 58; i >= 0; --i){
if(fib[i]<=n){
sum += two[i];
n-=fib[i];
}
if(n<=0) break;
}
cout<<sum<<endl;
}
return 0;
}