You are given an array a consisting of n integers. Indices of the array start from zero (i. e. the first element is a_0, the second one is a_1, and so on).

You can reverse at most one subarray (continuous subsegment) of this array. Recall that the subarray of a with borders l and r is a[l; r] = a_l, a_{l + 1}, ..., a_{r}.

Your task is to reverse such a subarray that the sum of elements on even positions of the resulting array is maximized (i. e. the sum of elements a_0, a_2, ..., a_{2k} for integer k = ⌊(n-1)/(2)⌋ should be maximum possible).

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 2 ⋅ 10^4) — the number of test cases. Then t test cases follow.

The first line of the test case contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the length of a. The second line of the test case contains n integers a_0, a_1, ..., a_{n-1} (1 ≤ a_i ≤ 10^9), where a_i is the i-th element of a.

It is guaranteed that the sum of n does not exceed 2 ⋅ 10^5 (∑ n ≤ 2 ⋅ 10^5).

Output

For each test case, print the answer on the separate line — the maximum possible sum of elements on even positions after reversing at most one subarray (continuous subsegment) of a.

Example

Input


4
8
1 7 3 4 7 6 2 9
5
1 2 1 2 1
10
7 8 4 5 7 6 8 9 7 3
4
3 1 2 1


Output


26
5
37
5
//package learning;
import java.util.*;
import java.io.*;
import java.lang.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class NitsLocal {
    static ArrayList<String> s1;
    static boolean[] prime;
    static int n = 200001;
    
     static void sieve() {
Arrays.fill(prime	, true);
prime[0] = prime[1] = false;
for(int i = 2 ; i * i <= n ; ++i) {
if(prime[i]) {
for(int k = i * i; k<= n ; k+=i) {
prime[k] = false;
}
}
}
 
}
    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        
           //prime  = new boolean[n + 1];
          // sieve();
                //prime[1] = false;
              
                  
             /*    
        int n = sc.ni();
        int k = sc.ni();
        int []vis = new int[n+1];
        int []a = new int[k];
        for(int i=0;i<k;i++)
        {
            a[i] = i+1;
        }
        int j = k+1;
        int []b = new int[n+1];
        for(int i=1;i<=n;i++)
        {
            b[i] = -1;
        }
        int y = n - k +1;
        int tr = 0;
        int y1 = k+1;
        while(y-- > 0)
        {
        System.out.print("? ");
        for(int i=0;i<k;i++)
        {
            System.out.print(a[i] + " ");
        }
        
        System.out.flush();
        int pos = sc.ni();
        int a1 = sc.ni();
        b[pos] = a1;
        
        
        for(int i=0;i<k;i++)
        {
            if(a[i] == pos)
            {
                a[i] = y1;
                y1++;
            }
        }
        }
        ArrayList<Integer> a2 = new ArrayList<>();
        if(y >= k)
        {
            
        int c = 0;
        int k1 = 0;
            for(int i=1;i<=n;i++)
            {
                if(b[i] != -1)
                {
                    c++;
                    a[k1] = i;
                    a2.add(b[i]);
                    k1++;
                }
                if(c==k)
                    break;
            }
            
            Collections.sort(a2);
            System.out.print("? ");
        for(int i=0;i<k;i++)
        {
            System.out.print(a[i] + " ");
        }
        System.out.println();
        System.out.flush();
        int pos = sc.ni();
        int a1 = sc.ni();
        int ans = -1;
        for(int i=0;i<a2.size();i++)
        {
            if(a2.get(i) == a1)
            {
                ans = i+1;
                break;
            }
        }
        System.out.println("!" + " " + ans);
           System.out.flush();  
        }
        else
        {
            int k1 = 0;
            a = new int[k];
             for(int i=1;i<=n;i++)
            {
                if(b[i] != -1)
                {
                    
                    a[k1] = i;
                    a2.add(b[i]);
                    k1++;
                }
             
            }
              for(int i=1;i<=n;i++)
            {
                if(b[i] == -1)
                {
                    
                    a[k1] = i;
                    
                    k1++;
                    if(k1==k)
                        break;
                }
             
            }
              int ans = -1;
              while(true)
              {
                   System.out.print("? ");
                     for(int i=0;i<k;i++)
                   {
                         System.out.print(a[i] + " ");
                  }
                   System.out.println();
                   System.out.flush();
                   int pos = sc.ni();
                   int a1 = sc.ni();
                   int f = 0;
                   
                   if(b[pos] != -1)
                   {
                       Collections.sort(a2);
                       for(int i=0;i<a2.size();i++)
                       {
                           if(a2.get(i) == a1)
                           {
                               ans = i+1;
                               f = 1;
                               System.out.println("!" + " " + ans);
                               System.out.flush();
                               break;
                           }
                       }
                       if(f==1)
                           break;
                   }
                   else
                   {
                       b[pos] = a1;
                        a = new int[k];
                        a2.add(a1);
             for(int i=1;i<=n;i++)
            {
                if(b[i] != -1)
                {
                    
                    a[k1] = i;
                    a2.add(b[i]);
                    k1++;
                }
             
            }
              for(int i=1;i<=n;i++)
            {
                if(b[i] == -1)
                {
                    
                    a[k1] = i;
                    
                    k1++;
                    if(k1==k)
                        break;
                }
             
                       
                   }
              }
        }  
          */
             
 
    /*
          int n = sc.ni();
          int []a = sc.nia(n);
          int []b = sc.nia(n);
          Integer []d = new Integer[n];
          int []d1 = new int[n];
          for(int i=0;i<n;i++)
          {
              d[i] = (a[i] - b[i]);
             
          }
          int l = 0;
          int r = n-1;
          Arrays.sort(d);
          long res = 0;
          while(l < r)
          {
              if(d[l] + d[r] > 0)
              {
                  res += (long) (r-l);
                  r--;
              }
              else 
                  l++;
          }
          
          w.println(res);
*/
      /*
      int n = sc.ni();
     
      ArrayList<Integer> t1 = new ArrayList<>();
      int []p1 = new int[n+1];
      int []q1 = new int[n-1];
      int []q2 = new int[n-1];
      for(int i=0;i<n-1;i++)
      {
          int p = sc.ni();
          int q = sc.ni();
          t1.add(q);
          p1[p]++;
          q1[i] = p;
          q2[i] = q;
          
      }
      int res = 0;
      for(int i=0;i<t1.size();i++)
      {
          if(p1[t1.get(i)] == 0)
          {
              res = t1.get(i);
              //break;
          }
      }
      
    int y = 1;
    for(int i=0;i<n-1;i++)
    {
        if(q2[i] == res)
        {
            w.println("0");
        }
        else
        {
            w.println(y + " ");
            y++;
        }
    }
      */
 /*
   int n = sc.ni();
   int k = sc.ni();
   Integer []a = new Integer[n];
   for(int i=0;i<n;i++)
   {
       a[i] = sc.ni();
       a[i] = a[i]%k;
   }
   HashMap<Integer,Integer> hm = new HashMap<>();
   for(int i=0;i<n;i++)
   {
       if(!hm.containsKey(a[i]))
           hm.put(a[i], 1);
       else
           hm.put(a[i], hm.get(a[i]) + 1);
   }
  Arrays.sort(a);
  int z = 0;
  long res = 0;
  HashMap<Integer,Integer> v = new HashMap<>();
  for(int i=0;i<n;i++)
  {
      if(a[i] == 0)
          res++;
      else
      {
          if(a[i] == k-a[i] && !v.containsKey(a[i]))
          {
              res += (long) hm.get(a[i]) / 2;
              v.put(a[i],1);
          }
          else
          {
          if(hm.containsKey(a[i]) && hm.containsKey(k-a[i]))
          {
          int temp = a[i];
          
          if(!v.containsKey(a[i]) && !v.containsKey(k-a[i]))
          {
             res += (long) Math.min(hm.get(temp), hm.get(k-temp));
             v.put(temp,1);
             v.put(k-temp,1);
          }
          }
          }
      }
  }
  w.println(res);
*/
 /*
int []a = new int[4];
//G0
a[0] = 0;
a[1] = 1;
a[2] = 0;
a[3] = 1;
int []b = new int[4];
//g1
b[0] = 0;
b[1] = 1;
b[2] = 1;
b[3] = 0;
int [][]dp1 = new int[4][4];
int [][]dp2 = new int[4][4];
for(int i=0;i<4;i++)
{
    for(int j=0;j<4;j++)
    {
        dp1[i][j] = (a[i] | a[j]);
    }
   // w.println();
}
w.println();
for(int i=0;i<4;i++)
{
    for(int j=0;j<4;j++)
    {
        dp2[i][j] = (b[i] | b[j]);
    }
    //w.println();
}
int a1 = 0;
int b1 = 0;
int c1 = 0;
int d1 = 0;
for(int i=0;i<4;i++)
{
    for(int j=0;j<4;j++)
    {
        if(dp1[i][j] == 0 && dp2[i][j] == 0)
            a1++;
        else  if(dp1[i][j] == 1 && dp2[i][j] == 1)
            b1++;
        else  if(dp1[i][j] == 0 && dp2[i][j] == 1)
            c1++;
        else
            d1++;
       
    }
}
w.println(a1+ " " + b1 + " " + c1 +" "+ d1);

Scanner sc = new Scanner(System.in);
    int q = sc.nextInt();
    while(q-- > 0)
    {
        long x = sc.nextLong();
        long y = sc.nextLong();
        long a = (x - y)/2;  
        long a1 = 0, b1 = 0; 
        
        
        int lim     = 8; 
  
   
    int f = 0;
    
    for (int i=0; i<8*lim; i++)  
    {  
        long pi = (y & (1 << i));  
        long qi = (a & (1 << i));  
        if (pi == 0 && qi == 0)  
        {  
             
        }  
        else if (pi == 0 && qi > 0)  
        {  
            a1 = ((1 << i) | a1);  
            b1 = ((1 << i) | b1);  
        }  
        else if (pi > 0 && qi == 0)  
        {  
            a1 = ((1 << i) | a1);  
  
           
        }  
        else
        {  
            f = 1;  
            
        }  
    }  
    if(a1+b1 != x)
        f  =1;
  if(f==1)
            System.out.println("-1");
  else
  {
       if(a1 > b1)
       {
           long temp = a1;
           a1 = b1;
           b1 = temp;
       }
    System.out.println(a1 + " " + b1);
   
  }
  
  
    }
     
     */
int t = sc.ni();
while(t-- > 0)
{
   
   
   int n = sc.ni();
   int []a = sc.nia(n);
   
   ArrayList<Long> res = new ArrayList<>();
    
   long ev = 0;
   long swap1 = 0;
   long swap2 = 0;
   long max = 0;
   
   for(int i=0;i<n;i++)
   {
       if(i%2==0)
       {
           ev += (long) a[i];
           swap1 -= (long) a[i];
           swap2 -= (long) a[i];
           swap1 = Math.max(swap1,0);
           max = Math.max(swap1,max);
           
       }
       else
       {
           swap1 += (long) a[i];
           swap2 += (long) a[i];
           swap2 = Math.max(swap2,0);
           max = Math.max(swap2,max);
           
       }
           
       
       
      
   }
   w.println(ev + max);
  
     
       
   

          
}
       w.close();
       
        
    
    
} 
    
    
  static int l,r;  
    static long nCrModPFermat(int n, int r, 
                                    long p) 
    { 
          
        // Base case 
        if (r == 0) 
            return 1; 
      
        // Fill factorial array so that we 
        // can find all factorial of r, n 
        // and n-r 
       
          
        
           
      
        return (fact[n]* modInverse(fact[r], p) % p * modInverse(fact[n-r], p) % p) % p; 
    } 
   static long []fact;
    static int []res;
    static int c = 0;
    static class Pair{
        int fir;
        int last;
        int f;
        Pair(int fir,int last,int f)
        {
            this.fir = fir;
            this.last = last;
            this.f = f;
        }
    }
    static class m1 implements Comparator<Pair>{
        public int compare(Pair a, Pair b)
        {
           
            if(a.fir < b.fir)
                return -1;
            else if(a.fir > b.fir)
                return 1;
            else
            {
                if(a.last < b.last)
                    return -1;
                else
                    return 1;
            }
        }
    }
   
    static long calc(long x)
    {
        double res = Math.sqrt(1 + 24*(double)x);
        res -= 1.0;
        res = res / (double) 6;
        return (long) res;
    }
   
 public static final BigInteger MOD = BigInteger.valueOf(998244353L);
    
    static BigInteger fact(int x)
    {
        BigInteger res = BigInteger.ONE;
        for(int i=2;i<=x;i++)
        {
            res = res.multiply(BigInteger.valueOf(i)).mod(MOD);
        }
        return res;
    }
   
    public static long calc(int x,int y,int z)
    {
        long res = ((long) (x-y) * (long) (x-y)) + ((long) (z-y) * (long) (z-y)) + ((long) (x-z) * (long) (x-z));
        return res;
    }
    
    public static int upperBound(ArrayList<Integer>arr, int length, int value) {
        int low = 0;
        int high = length;
        while (low < high) {
            final int mid = (low + high) / 2;
            if (value >= arr.get(mid)) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        return low;
    }
    
     public static int lowerBound(ArrayList<Integer> arr, int length, int value) {
        int low = 0;
        int high = length;
        while (low < high) {
            final int mid = (low + high) / 2;
            //checks if the value is less than middle element of the array
            if (value <= arr.get(mid)) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }
        return low;
    }
    static HashMap<Long,Integer> map;
  
          
    static class Coin{
        long a;
        long b;
        
        Coin(long a, long b)
        {
            this.a = a;
            this.b = b;
           
        }
    }
    static ArrayList<Long> fac;
    static HashSet<Long> hs;
    public static void primeFactors(long n) 
    { 
        // Print the number of 2s that divide n 
        while (n % 2 == 0) { 
            fac.add(2l);
            hs.add(2l);
            n /= 2; 
        } 
  
        // n must be odd at this point.  So we can 
        // skip one element (Note i = i +2) 
        for (long i = 3; i*i <= n; i += 2) { 
            // While i divides n, print i and divide n 
            while (n % i == 0) { 
                fac.add(i);
                hs.add(i);
                n /= i; 
            } 
        } 
  
        // This condition is to handle the case whien 
        // n is a prime number greater than 2 
        if (n > 2) 
            fac.add(n);
    } 
   static int smallestDivisor(int n)  
{  
    // if divisible by 2  
    if (n % 2 == 0)  
        return 2;  
  
    // iterate from 3 to sqrt(n)  
    for (int i = 3; i * i <= n; i += 2) {  
        if (n % i == 0)  
            return i;  
    }  
  
    return n;  
}  
 static boolean IsP(String s,int l,int r)
 {
      while(l <= r)
      {
          if(s.charAt(l) != s.charAt(r))
          {
              return false;
          }
         l++;
         r--;
      }
      return true;
 }
  
	

    
    
 static class Student{
    int id;
    int val;
     Student(int id,int val)
     {
      this.id = id;
      this.val = val;
     }
 }
   
   
   
 
     static int upperBound(ArrayList<Integer> a, int low, int high, int element){
    while(low < high){
        int middle = low + (high - low)/2;
        if(a.get(middle) >= element)
            high = middle;
        else 
            low = middle + 1;
    }
    return low;
}
   static long func(long t,long e,long h,long a, long b)
   {
       if(e*a >= t)
           return t/a;
       else
       {
           return e + Math.min(h,(t-e*a)/b);
       }
   }
         
      
   
    public static int countSetBits(int number){
        int count = 0;
        while(number>0){
            ++count;
            number &= number-1;
        }
        return count;
    }
    
     
      
 
    
   
     static long modexp(long x,long n,long M)
{
    long power = n;
    long result=1;
    x = x%M;
    while(power>0)
    {
        if(power % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        power = power/2;
    }
    return result;
}
      static long modInverse(long A,long M)
{
    return modexp(A,M-2,M);
}
    static long gcd(long a,long b)
    {
        if(a==0)
            return b;
        else
            return gcd(b%a,a);
    }
    static class Temp{
        int a;
        int b;
        int c;
        int d;
      
        Temp(int a,int b,int c,int d)
        {
            this.a = a;
            this.b = b;
            this.c  =c;
            this.d = d;
            //this.d = d;
        }
    }
   
    
    
   static long sum1(int t1,int t2,int x,int []t)
   {
       int mid = (t2-t1+1)/2;
  if(t1==t2)
      return 0;
    
   else
   return sum1(t1,mid-1,x,t) + sum1(mid,t2,x,t);
    
     
   }
  
   
    static String replace(String s,int a,int n)
    {
        char []c = s.toCharArray();
        for(int i=1;i<n;i+=2)
        {
            int num = (int) (c[i] - 48);
            num += a;
            num%=10;
            c[i] = (char) (num+48);
        }
        return new String(c);
    }
    static String move(String s,int h,int n)
    {
        h%=n;
        char []c = s.toCharArray();
        char []temp = new char[n];
        for(int i=0;i<n;i++)
        {
            temp[(i+h)%n] = c[i];
        }
        return new String(temp);
    }
    
     public static int ip(String s){
return Integer.parseInt(s);
}
     static class multipliers implements Comparator<Long>{
  
         
  public int compare(Long a,Long b) {
   if(a<b)
    return 1;
   else if(b<a)
    return -1;
   else
    return 0;
  }
 }
     
     static class multipliers1 implements Comparator<Coin>{
  
  public int compare(Coin a,Coin b) {
   if(a.a < b.a)
       return 1;
   else if(a.a > b.a)
       return -1;
   else{ 
       if(a.b < b.b)
       return 1;
   else if(a.b > b.b)
       return -1;
       else
       return 0;
   }
       
  
 
     }
     }
     
// Java program to generate power set in 
// lexicographic order. 
 
    
    
    
      static class InputReader {
 
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
 
public InputReader(InputStream st) {
this.stream = st;
}
 
public int read() {
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
snumChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
 
public int ni() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
 
public long nl() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
long res = 0;
do {
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
 
public int[] nia(int n) {
int a[] = new int[n];
for (int i = 0; i < n; i++) {
a[i] = ni();
}
return a;
}
 
public String rs() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
 
public String nextLine() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isEndOfLine(c));
return res.toString();
}
 
public boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
 
private boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
 
}
 
 
 
 
 
   
static PrintWriter w = new PrintWriter(System.out);
                  static class Student1
    {
        int id;
        //int x;
       
       int b;
      
        //long z;
        
        Student1(int id,int b)
        {
            this.id = id;
            //this.x = x;
            //this.s = s;
            this.b = b;
          
           // this.z = z;
            
            
            
           
        }
        
    }
}