// http://c...content-available-to-author-only...s.com/contest/789/problem/C
#include<bits/stdc++.h>
#include<unordered_set>
using namespace std;
#define fio ios_base::sync_with_stdio(false)
#define ll long long int
#define s(x) scanf("%lld",&x)
#define s2(x,y) s(x)+s(y)
#define s3(x,y,z) s(x)+s(y)+s(z)
#define p(x) printf("%lld\n",x)
#define p2(x,y) p(x)+p(y)
#define p3(x,y,z) p(x)+p(y)+p(z)
#define F(i,a,b) for(ll i = (ll)(a); i <= (ll)(b); i++)
#define RF(i,a,b) for(ll i = (ll)(a); i >= (ll)(b); i--)
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pll pair<ll,ll>
#define pb push_back
// TEMPLATE FOR POLICY BASED DATA STRUCTURES //
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> OST;
// TEMPLATE OVER //
ll inf = 1e18;
ll mod = 1e9 + 7 ;
ll gcd(ll a , ll b){return b==0?a:gcd(b,a%b);}
ll n;
ll kadane(vector<ll>ar){
ll sum;
sum=ar[0];
ll ans=ar[0];
for(ll i=1;i<n-1;i++){
if(sum<0){
sum=ar[i];
}
else sum+=ar[i];
ans=max(ans,sum);
}
return ans;
}
int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ll t=1;
s(t);
while(t--){
s(n);
vector<ll>ar(n+1);
vector<ll>ar1;
vector<ll>ar2;
F(i,0,n-1)cin>>ar[i];
F(i,1,n-1){
ll num = abs(ar[i]-ar[i-1]);
ar1.pb(num); ar2.pb(num);
}
for(ll i=0;i<n-1;i+=2)ar1[i]=-ar1[i];
for(ll i=1;i<n-1;i+=2)ar2[i]=-ar2[i];
cout<<max(kadane(ar1),kadane(ar2))<<endl;
}
}
Ci8vIGh0dHA6Ly9jLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5zLmNvbS9jb250ZXN0Lzc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