import java.util.*;
import java.io.*;

public class C{

	public static void main(String[] args)  throws IOException,NumberFormatException{
		try {
		FastScanner sc=new FastScanner();
		int t=sc.nextInt();
		while(t-->0) {
			int n=sc.nextInt();
			int count=n;
			for(int i=4*n;i>=(2*n+2)&&count!=0;i-=2) {
				System.out.print(i+" ");
				count--;
			}
			System.out.println();

		}
		}
		catch(Exception e) {
			return ;
		}

	}

	public static boolean isPrime(int n) {
		if(n==0)return false;
		for(int i=2;i*i<=n;i++) {
			if(n%i==0)return false;
		}
		return true;
	}

	public static class Pair<L,R> {
	    private L l;
	    private R r;
	    public Pair(L l, R r){
	        this.l = l;
	        this.r = r;
	    }
	    public L getL(){ return l; }
	    public R getR(){ return r; }
	    public void setL(L l){ this.l = l; }
	    public void setR(R r){ this.r = r; }
	}

	static final Random random=new Random();

	static void ruffleSort(int[] a) {
		int n=a.length;
		for(int i=0;i<n;i++) {
			int oi=random.nextInt(n),temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}

	public static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
                                      st=new StringTokenizer(br.readLine());
                              } catch (IOException e) {}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}

		long[] readLongArray(int n) {
			long[] a=new long[n];
			for(int i=0; i<n ; i++) a[i]=nextLong();
			return a;
		}

		String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
	}

}


import java.util.*;
import java.io.*;

public class C{

	public static void main(String[] args)  throws IOException,NumberFormatException{
		try {
		FastScanner sc=new FastScanner();
		int t=sc.nextInt();
		while(t-->0) {
			int n=sc.nextInt();
			boolean a[]=new boolean[5001];
			Arrays.fill(a, true);
			a[0]=a[1]=false;
			for(int i=2;i*i<=5000;i++) {
				if(a[i]==true) {
					for(int j=i*i;j<=5000;j+=i) {
						a[j]=false;
					}
				}
			}
			int count=0;
			for(int i=2;i<=5000;i++) {
				if(a[i]==true) {
					System.out.print((i*2)+" ");
					count++;
				}
				if(count==n)break;
			}
			System.out.println();

		}
		}
		catch(Exception e) {
			return ;
		}

	}

	public static class Pair<L,R> {
	    private L l;
	    private R r;
	    public Pair(L l, R r){
	        this.l = l;
	        this.r = r;
	    }
	    public L getL(){ return l; }
	    public R getR(){ return r; }
	    public void setL(L l){ this.l = l; }
	    public void setR(R r){ this.r = r; }
	}

	static final Random random=new Random();

	static void ruffleSort(int[] a) {
		int n=a.length;
		for(int i=0;i<n;i++) {
			int oi=random.nextInt(n),temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}

	public static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
                                      st=new StringTokenizer(br.readLine());
                              } catch (IOException e) {}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}

		long[] readLongArray(int n) {
			long[] a=new long[n];
			for(int i=0; i<n ; i++) a[i]=nextLong();
			return a;
		}

		String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
	}

}


import java.util.*;
import java.io.*;

public class C{

	public static void main(String[] args)  throws IOException,NumberFormatException{
		try {
		FastScanner sc=new FastScanner();
		int t=sc.nextInt();
		while(t-->0) {
			int n=sc.nextInt();
			int count=n;
			for(int i=2;i<=1e5&&count!=0;i++) {
				if(isPrime(i)) {
					System.out.print((2*i)+" ");
					count--;
				}
			}
			System.out.println();

		}
		}
		catch(Exception e) {
			return ;
		}

	}

	public static boolean isPrime(int n) {
		if(n==0)return false;
		for(int i=2;i*i<=n;i++) {
			if(n%i==0)return false;
		}
		return true;
	}

	public static class Pair<L,R> {
	    private L l;
	    private R r;
	    public Pair(L l, R r){
	        this.l = l;
	        this.r = r;
	    }
	    public L getL(){ return l; }
	    public R getR(){ return r; }
	    public void setL(L l){ this.l = l; }
	    public void setR(R r){ this.r = r; }
	}

	static final Random random=new Random();

	static void ruffleSort(int[] a) {
		int n=a.length;
		for(int i=0;i<n;i++) {
			int oi=random.nextInt(n),temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}

	public static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
                                      st=new StringTokenizer(br.readLine());
                              } catch (IOException e) {}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}

		long[] readLongArray(int n) {
			long[] a=new long[n];
			for(int i=0; i<n ; i++) a[i]=nextLong();
			return a;
		}

		String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
	}

}


import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
//@Author Why_Do_You_Want_To_Know_My_Name?

public class Main {
    public static void main(String[] args) {
        Charset charset = Charset.forName("ascii");
        FastIO sc = new FastIO(System.in, System.out, charset);
        int t = sc.readInt();
        while (t-- > 0) {
            int n = sc.readInt();
            int start = 2 * n;
            for (int i = 0; i < n - 1; i++) {
                System.out.print(start + " ");
                start += 2;
            }
            System.out.println(start);
            sc.flush();
        }
    }
}

class FastIO {
    public final StringBuilder cache = new StringBuilder(1 << 20);
    private final InputStream is;
    private final OutputStream os;
    private final Charset charset;
    private StringBuilder defaultStringBuf = new StringBuilder(1 << 8);
    private byte[] buf = new byte[1 << 13];
    private int bufLen;
    private int bufOffset;
    private int next;

    public FastIO(InputStream is, OutputStream os, Charset charset) {
        this.is = is;
        this.os = os;
        this.charset = charset;
    }

    public FastIO(InputStream is, OutputStream os) {
        this(is, os, Charset.forName("ascii"));
    }

    private int read() {
        while (bufLen == bufOffset) {
            bufOffset = 0;
            try {
                bufLen = is.read(buf);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            if (bufLen == -1) {
                return -1;
            }
        }
        return buf[bufOffset++];
    }

    public void skipBlank() {
        while (next >= 0 && next <= 32) {
            next = read();
        }
    }

    public int readInt() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        int val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public long readLong() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        long val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public double readDouble() {
        boolean sign = true;
        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+';
            next = read();
        }

        long val = 0;
        while (next >= '0' && next <= '9') {
            val = val * 10 + next - '0';
            next = read();
        }
        if (next != '.') {
            return sign ? val : -val;
        }
        next = read();
        long radix = 1;
        long point = 0;
        while (next >= '0' && next <= '9') {
            point = point * 10 + next - '0';
            radix = radix * 10;
            next = read();
        }
        double result = val + (double) point / radix;
        return sign ? result : -result;
    }

    public String readString(StringBuilder builder) {
        skipBlank();

        while (next > 32) {
            builder.append((char) next);
            next = read();
        }

        return builder.toString();
    }

    public String readString() {
        defaultStringBuf.setLength(0);
        return readString(defaultStringBuf);
    }

    public int readLine(char[] data, int offset) {
        int originalOffset = offset;
        while (next != -1 && next != '\n') {
            data[offset++] = (char) next;
            next = read();
        }
        return offset - originalOffset;
    }

    public int readString(char[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (char) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public int readString(byte[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (byte) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public char readChar() {
        skipBlank();
        char c = (char) next;
        next = read();
        return c;
    }

    public void flush() {
        try {
            os.write(cache.toString().getBytes(charset));
            os.flush();
            cache.setLength(0);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public boolean hasMore() {
        skipBlank();
        return next != -1;
    }
}


import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
//@Author Why_Do_You_Want_To_Know_My_Name?

public class Main {
    public static void main(String[] args) {
        Charset charset = Charset.forName("ascii");
        FastIO sc = new FastIO(System.in, System.out, charset);
        int t = sc.readInt();
        while (t-- > 0) {
            int n = sc.readInt();
            int start = 4;
            for (int i = 0; i < n - 1; i++) {
                start += 2;
                System.out.print(start + " ");
                start += 2;
            }
            System.out.println(start);
            sc.flush();
        }
    }
}

class FastIO {
    public final StringBuilder cache = new StringBuilder(1 << 20);
    private final InputStream is;
    private final OutputStream os;
    private final Charset charset;
    private StringBuilder defaultStringBuf = new StringBuilder(1 << 8);
    private byte[] buf = new byte[1 << 13];
    private int bufLen;
    private int bufOffset;
    private int next;

    public FastIO(InputStream is, OutputStream os, Charset charset) {
        this.is = is;
        this.os = os;
        this.charset = charset;
    }

    public FastIO(InputStream is, OutputStream os) {
        this(is, os, Charset.forName("ascii"));
    }

    private int read() {
        while (bufLen == bufOffset) {
            bufOffset = 0;
            try {
                bufLen = is.read(buf);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            if (bufLen == -1) {
                return -1;
            }
        }
        return buf[bufOffset++];
    }

    public void skipBlank() {
        while (next >= 0 && next <= 32) {
            next = read();
        }
    }

    public int readInt() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        int val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public long readLong() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        long val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public double readDouble() {
        boolean sign = true;
        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+';
            next = read();
        }

        long val = 0;
        while (next >= '0' && next <= '9') {
            val = val * 10 + next - '0';
            next = read();
        }
        if (next != '.') {
            return sign ? val : -val;
        }
        next = read();
        long radix = 1;
        long point = 0;
        while (next >= '0' && next <= '9') {
            point = point * 10 + next - '0';
            radix = radix * 10;
            next = read();
        }
        double result = val + (double) point / radix;
        return sign ? result : -result;
    }

    public String readString(StringBuilder builder) {
        skipBlank();

        while (next > 32) {
            builder.append((char) next);
            next = read();
        }

        return builder.toString();
    }

    public String readString() {
        defaultStringBuf.setLength(0);
        return readString(defaultStringBuf);
    }

    public int readLine(char[] data, int offset) {
        int originalOffset = offset;
        while (next != -1 && next != '\n') {
            data[offset++] = (char) next;
            next = read();
        }
        return offset - originalOffset;
    }

    public int readString(char[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (char) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public int readString(byte[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (byte) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public char readChar() {
        skipBlank();
        char c = (char) next;
        next = read();
        return c;
    }

    public void flush() {
        try {
            os.write(cache.toString().getBytes(charset));
            os.flush();
            cache.setLength(0);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public boolean hasMore() {
        skipBlank();
        return next != -1;
    }
}


import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
//@Author Why_Do_You_Want_To_Know_My_Name?

public class Main {
    public static void main(String[] args) {
        Charset charset = Charset.forName("ascii");
        FastIO sc = new FastIO(System.in, System.out, charset);
        int t=sc.readInt();
        while (t-->0){
            int n = sc.readInt();
            int start = 4;
            for (int i = 0; i < n-1; i++) {
                System.out.print(start+" ");
                start+=2;
            }
            System.out.println(start);
            sc.flush();
        }
    }
}
class FastIO {
    public final StringBuilder cache = new StringBuilder(1 << 20);
    private final InputStream is;
    private final OutputStream os;
    private final Charset charset;
    private StringBuilder defaultStringBuf = new StringBuilder(1 << 8);
    private byte[] buf = new byte[1 << 13];
    private int bufLen;
    private int bufOffset;
    private int next;

    public FastIO(InputStream is, OutputStream os, Charset charset) {
        this.is = is;
        this.os = os;
        this.charset = charset;
    }

    public FastIO(InputStream is, OutputStream os) {
        this(is, os, Charset.forName("ascii"));
    }

    private int read() {
        while (bufLen == bufOffset) {
            bufOffset = 0;
            try {
                bufLen = is.read(buf);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            if (bufLen == -1) {
                return -1;
            }
        }
        return buf[bufOffset++];
    }

    public void skipBlank() {
        while (next >= 0 && next <= 32) {
            next = read();
        }
    }

    public int readInt() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        int val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public long readLong() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        long val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public double readDouble() {
        boolean sign = true;
        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+';
            next = read();
        }

        long val = 0;
        while (next >= '0' && next <= '9') {
            val = val * 10 + next - '0';
            next = read();
        }
        if (next != '.') {
            return sign ? val : -val;
        }
        next = read();
        long radix = 1;
        long point = 0;
        while (next >= '0' && next <= '9') {
            point = point * 10 + next - '0';
            radix = radix * 10;
            next = read();
        }
        double result = val + (double) point / radix;
        return sign ? result : -result;
    }

    public String readString(StringBuilder builder) {
        skipBlank();

        while (next > 32) {
            builder.append((char) next);
            next = read();
        }

        return builder.toString();
    }

    public String readString() {
        defaultStringBuf.setLength(0);
        return readString(defaultStringBuf);
    }

    public int readLine(char[] data, int offset) {
        int originalOffset = offset;
        while (next != -1 && next != '\n') {
            data[offset++] = (char) next;
            next = read();
        }
        return offset - originalOffset;
    }

    public int readString(char[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (char) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public int readString(byte[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (byte) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public char readChar() {
        skipBlank();
        char c = (char) next;
        next = read();
        return c;
    }

    public void flush() {
        try {
            os.write(cache.toString().getBytes(charset));
            os.flush();
            cache.setLength(0);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public boolean hasMore() {
        skipBlank();
        return next != -1;
    }
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int t = sc.nextInt();

		for ( int zzz=0; zzz<t; zzz++ ) {
			int n = sc.nextInt();

			String[] a = new String[n];

			for ( int i=0; i<n; i++ ) {
				a[i] = String.valueOf(n*4-i*2);
			}

			System.out.println(String.join(" ", a));
		}
	}
}


import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int t = sc.nextInt();

		for ( int zzz=0; zzz<t; zzz++ ) {
			int n = sc.nextInt();

			String[] a = new String[n];
			Arrays.fill(a, "");
			LinkedList<Integer> p = new LinkedList<>();
			a[0] = "4";
			p.addLast(4);

			int k = 4;
			for ( int i=1; i<n; i++ ) {
				while ( a[i].equals("") ) {
					k += 2;
					boolean f = true;
					for ( Integer e : p ) {
						if ( k%e==0 ) {
							f=false;
						}
					}
					if ( f ) {
						a[i] = String.valueOf(k);
					}
				}
			}

			System.out.println(String.join(" ", a));
		}
	}
}


import java.util.Scanner;

public class Main {
public static void main(String[] args) {
    Scanner in=new Scanner(System.in);
    int t=in.nextInt();
    while(t-->0)
    {
        int n=in.nextInt();
        int temp=2*n+2;
        while(n-->0)
        {
            System.out.print(temp+ " ");
            temp=temp+2;
        }
        System.out.println("");
    }

}
}


import java.util.Scanner;

public class Main {
public static void main(String[] args) {
    Scanner in=new Scanner(System.in);
    int t=in.nextInt();
    while(t-->0)
    {
        int n=in.nextInt();
        int temp=2;
        while(n-->0)
        {
            System.out.print(temp+ " ");
            temp=temp+2;
        }
        System.out.println("");
    }

}
}


import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Random;
import java.io.FileWriter;
import java.io.PrintWriter;
/*
    Solution Created: 16:58:05 02/11/2020
    Custom Competitive programming helper.
*/

public class Main {
	public static void solve(Reader in, Writer out) {
		int t = in.nextInt();
		while(t-->0) {
			int n = in.nextInt();
			int cur = 4*n;
			out.print(cur+" ");
			ArrayList<Integer> used = new ArrayList<Integer>();
			used.add(cur);
			for(int i = 1; i<n; i++) {
				outer:
				while(true) {
					for(int k : used) {
						if(k%cur==0 || Util.gcd(cur, k)==1) {
							cur-=2;
							continue outer;
						}
					}
					break;
				}
				used.add(cur);
				out.print(cur+" ");
				cur-=2;
			}
			out.println();
		}
	}
	public static void main(String[] args) {
		Reader in = new Reader();
		Writer out = new Writer();
		solve(in, out);
		out.exit();
	}

static class Reader {
	static BufferedReader br;
	static StringTokenizer st;
	private int charIdx = 0;
	private String s;

	public Reader() {
		this.br = new BufferedReader(new InputStreamReader(System.in));
	}

	public Reader(String f){
		try {
			this.br = new BufferedReader(new FileReader(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public double[] nd(int n) {
		double[] a = new double[n];
		for (int i = 0; i < n; i++)
			a[i] = nextDouble();
		return a;
	}

	public char nextChar() {
		if (s == null || charIdx >= s.length()) {
			if (st == null || !st.hasMoreTokens())
				try {
					readLine();
				} catch (Exception e) {
				}
			s = st.nextToken();
			charIdx = 0;
		}
		return s.charAt(charIdx++);
	}

	public long[] nl(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}

	public char[] nca() {
		return next().toCharArray();
	}

	public String[] nS(int n) {
		String[] a = new String[n];
		for (int i = 0; i < n; i++)
			a[i] = next();
		return a;
	}

	public int nextInt() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Integer.parseInt(st.nextToken());
	}

	public double nextDouble() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Double.parseDouble(st.nextToken());
	}

	public Long nextLong() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Long.parseLong(st.nextToken());
	}

	public String next() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return st.nextToken();
	}

	public static void readLine() {
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
		}
	}
}

static class Util{
		private static Random random = new Random();
		static long[] fact;
		public static void initFactorial(int n, long mod) {
			fact = new long[n+1];
			fact[0] = 1;
			for (int i = 1; i < n+1; i++) fact[i] = (fact[i - 1] * i) % mod;
		}
		public static long modInverse(long a, long MOD) {
			long[] gcdE = gcdExtended(a, MOD);
			if (gcdE[0] != 1) return -1; // Inverted doesn't exist
			long x = gcdE[1];
			return (x % MOD + MOD) % MOD;
		}
		public static long[] gcdExtended(long p, long q) {
			if (q == 0) return new long[] { p, 1, 0 };
			long[] vals = gcdExtended(q, p % q);
			long tmp = vals[2];
			vals[2] = vals[1] - (p / q) * vals[2];
			vals[1] = tmp;
			return vals;
		}
		public static long nCr(int n, int r, long MOD) {
			if (r == 0) return 1;
			return (fact[n] * modInverse(fact[r], MOD) % MOD * modInverse(fact[n - r], MOD) % MOD) % MOD;
		}
		public static long nCr(int n, int r) {
			return (fact[n]/fact[r])/fact[n-r];
		}
		public static long nPr(int n, int r, long MOD) {
			if (r == 0) return 1;
			return (fact[n] * modInverse(fact[n - r], MOD) % MOD) % MOD;
		}
		public static long nPr(int n, int r) {
			return fact[n]/fact[n-r];
		}
		public static boolean isPrime(int n) {
	        if (n <= 1) return false;
	        if (n <= 3) return true;
	        if (n % 2 == 0 || n % 3 == 0) return false;
	        for (int i = 5; i * i <= n; i = i + 6)
	            if (n % i == 0 || n % (i + 2) == 0)
	            return false;
	        return true;
	    }
	    public static int lowerBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int lowerBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int upperBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static int upperBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static boolean[] getSieve(int n) {
	        boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) isPrime[i] = true;
	        for (int i = 2; i*i <= n; i++) if (isPrime[i])
	                for (int j = i; i*j <= n; j++) isPrime[i*j] = false;
	        return isPrime;
	    }
	    public static int gcd(int a, int b) {
	    	int tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static long gcd(long a, long b) {
	    	long tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static int random(int min, int max) {
	    	return random.nextInt(max-min+1)+min;
	    }
		public static void dbg(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
		public static void reverse(int[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				int tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(int[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(long[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				long tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(long[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(float[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				float tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(float[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(double[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				double tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(double[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(char[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				char tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(char[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static <T> void reverse(T[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				T tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static <T> void reverse(T[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void shuffle(int[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            int t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(long[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            long t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(float[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            float t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(double[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            double t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(char[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            char t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static <T> void shuffle(T[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            T t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
		public static void sortArray(int[] a) {
	        shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(long[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(float[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(double[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(char[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static <T extends Comparable<T>> void sortArray(T[] a) {
	        Arrays.sort(a);
	    }
	}

static class Writer {
	private PrintWriter pw;
	public Writer(){
		pw = new PrintWriter(System.out);
	}

	public Writer(String f){
		try {
			pw = new PrintWriter(new FileWriter(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void printArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void printArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void print(Object o) {
		pw.print(o.toString());
	}
	public void println(Object o) {
		pw.println(o.toString());
	}
	public void println() {
		pw.println();
	}
	public void flush() {
		pw.flush();
	}
	public void exit() {
		pw.close();
	}
}
}


import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Random;
import java.io.FileWriter;
import java.io.PrintWriter;
/*
    Solution Created: 16:57:26 02/11/2020
    Custom Competitive programming helper.
*/

public class Main {
	public static void solve(Reader in, Writer out) {
		int t = in.nextInt();
		while(t-->0) {
			int n = in.nextInt();
			int cur = 4;
			out.print(4+" ");
			ArrayList<Integer> u = new ArrayList<Integer>();
			u.add(cur);
			for(int i = 1; i<n; i++) {
				if(cur%4==0) cur+=2;
				out.print(cur+" ");
				u.add(cur);
				cur+=2;
			}
			out.println();
			out.println();
			Util.dbg(u);
			for(int i = 0; i<u.size(); i++) for(int j = i+1; j<u.size(); j++) {
				int a = u.get(i), b = u.get(j);
				if(Util.gcd(a,b)==1 || b%a==0) out.println(a+" "+b);
			}
			out.println();
		}
	}
	public static void main(String[] args) {
		Reader in = new Reader();
		Writer out = new Writer();
		solve(in, out);
		out.exit();
	}

static class Reader {
	static BufferedReader br;
	static StringTokenizer st;
	private int charIdx = 0;
	private String s;

	public Reader() {
		this.br = new BufferedReader(new InputStreamReader(System.in));
	}

	public Reader(String f){
		try {
			this.br = new BufferedReader(new FileReader(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public double[] nd(int n) {
		double[] a = new double[n];
		for (int i = 0; i < n; i++)
			a[i] = nextDouble();
		return a;
	}

	public char nextChar() {
		if (s == null || charIdx >= s.length()) {
			if (st == null || !st.hasMoreTokens())
				try {
					readLine();
				} catch (Exception e) {
				}
			s = st.nextToken();
			charIdx = 0;
		}
		return s.charAt(charIdx++);
	}

	public long[] nl(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}

	public char[] nca() {
		return next().toCharArray();
	}

	public String[] nS(int n) {
		String[] a = new String[n];
		for (int i = 0; i < n; i++)
			a[i] = next();
		return a;
	}

	public int nextInt() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Integer.parseInt(st.nextToken());
	}

	public double nextDouble() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Double.parseDouble(st.nextToken());
	}

	public Long nextLong() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Long.parseLong(st.nextToken());
	}

	public String next() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return st.nextToken();
	}

	public static void readLine() {
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
		}
	}
}

static class Util{
		private static Random random = new Random();

		public static long modInverse(long a, long MOD) {
			long[] gcdE = gcdExtended(a, MOD);
			if (gcdE[0] != 1) return -1; // Inverted doesn't exist
			long x = gcdE[1];
			return (x % MOD + MOD) % MOD;
		}
		public static long[] gcdExtended(long p, long q) {
			if (q == 0) return new long[] { p, 1, 0 };
			long[] vals = gcdExtended(q, p % q);
			long tmp = vals[2];
			vals[2] = vals[1] - (p / q) * vals[2];
			vals[1] = tmp;
			return vals;
		}
		public void fac(int n) {

		}
		public static boolean isPrime(int n) {
	        if (n <= 1) return false;
	        if (n <= 3) return true;
	        if (n % 2 == 0 || n % 3 == 0) return false;
	        for (int i = 5; i * i <= n; i = i + 6)
	            if (n % i == 0 || n % (i + 2) == 0)
	            return false;
	        return true;
	    }
	    public static int lowerBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int lowerBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int upperBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static int upperBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static boolean[] getSieve(int n) {
	        boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) isPrime[i] = true;
	        for (int i = 2; i*i <= n; i++) if (isPrime[i])
	                for (int j = i; i*j <= n; j++) isPrime[i*j] = false;
	        return isPrime;
	    }
	    public static int gcd(int a, int b) {
	    	int tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static long gcd(long a, long b) {
	    	long tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static int random(int min, int max) {
	    	return random.nextInt(max-min+1)+min;
	    }
		public static void dbg(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
		public static void reverse(int[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				int tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(int[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(long[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				long tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(long[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(float[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				float tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(float[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(double[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				double tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(double[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(char[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				char tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(char[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static <T> void reverse(T[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				T tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static <T> void reverse(T[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void shuffle(int[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            int t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(long[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            long t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(float[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            float t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(double[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            double t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(char[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            char t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static <T> void shuffle(T[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            T t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
		public static void sortArray(int[] a) {
	        shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(long[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(float[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(double[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(char[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static <T extends Comparable<T>> void sortArray(T[] a) {
	        Arrays.sort(a);
	    }
	}

static class Writer {
	private PrintWriter pw;
	public Writer(){
		pw = new PrintWriter(System.out);
	}

	public Writer(String f){
		try {
			pw = new PrintWriter(new FileWriter(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void printArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void printArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void print(Object o) {
		pw.print(o.toString());
	}
	public void println(Object o) {
		pw.println(o.toString());
	}
	public void println() {
		pw.println();
	}
	public void flush() {
		pw.flush();
	}
	public void exit() {
		pw.close();
	}
}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Random;
import java.io.FileWriter;
import java.io.PrintWriter;
/*
    Solution Created: 16:42:42 02/11/2020
    Custom Competitive programming helper.
*/
public class Main {
	public static void solve(Reader in, Writer out) {
		int t = in.nextInt();
		while(t-->0) {
			int n = in.nextInt();
			int cur = 4;
			out.print(4+" ");
			for(int i = 1; i<n; i++) {
				if(cur%4==0) cur+=2;
				out.print(cur+" ");
				cur+=2;
			}
			out.println();
		}
	}
	public static void main(String[] args) {
		Reader in = new Reader();
		Writer out = new Writer();
		solve(in, out);
		out.exit();
	}

static class Reader {
	static BufferedReader br;
	static StringTokenizer st;
	private int charIdx = 0;
	private String s;

	public Reader() {
		this.br = new BufferedReader(new InputStreamReader(System.in));
	}

	public Reader(String f){
		try {
			this.br = new BufferedReader(new FileReader(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public double[] nd(int n) {
		double[] a = new double[n];
		for (int i = 0; i < n; i++)
			a[i] = nextDouble();
		return a;
	}

	public char nextChar() {
		if (s == null || charIdx >= s.length()) {
			if (st == null || !st.hasMoreTokens())
				try {
					readLine();
				} catch (Exception e) {
				}
			s = st.nextToken();
			charIdx = 0;
		}
		return s.charAt(charIdx++);
	}

	public long[] nl(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}

	public char[] nca() {
		return next().toCharArray();
	}

	public String[] nS(int n) {
		String[] a = new String[n];
		for (int i = 0; i < n; i++)
			a[i] = next();
		return a;
	}

	public int nextInt() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Integer.parseInt(st.nextToken());
	}

	public double nextDouble() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Double.parseDouble(st.nextToken());
	}

	public Long nextLong() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Long.parseLong(st.nextToken());
	}

	public String next() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return st.nextToken();
	}

	public static void readLine() {
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
		}
	}
}

static class Util{
		private static Random random = new Random();

		public static long modInverse(long a, long MOD) {
			long[] gcdE = gcdExtended(a, MOD);
			if (gcdE[0] != 1) return -1; // Inverted doesn't exist
			long x = gcdE[1];
			return (x % MOD + MOD) % MOD;
		}
		public static long[] gcdExtended(long p, long q) {
			if (q == 0) return new long[] { p, 1, 0 };
			long[] vals = gcdExtended(q, p % q);
			long tmp = vals[2];
			vals[2] = vals[1] - (p / q) * vals[2];
			vals[1] = tmp;
			return vals;
		}
		public void fac(int n) {

		}
		public static boolean isPrime(int n) {
	        if (n <= 1) return false;
	        if (n <= 3) return true;
	        if (n % 2 == 0 || n % 3 == 0) return false;
	        for (int i = 5; i * i <= n; i = i + 6)
	            if (n % i == 0 || n % (i + 2) == 0)
	            return false;
	        return true;
	    }
	    public static int lowerBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int lowerBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int upperBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static int upperBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static boolean[] getSieve(int n) {
	        boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) isPrime[i] = true;
	        for (int i = 2; i*i <= n; i++) if (isPrime[i])
	                for (int j = i; i*j <= n; j++) isPrime[i*j] = false;
	        return isPrime;
	    }
	    public static int gcd(int a, int b) {
	    	int tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static long gcd(long a, long b) {
	    	long tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static int random(int min, int max) {
	    	return random.nextInt(max-min+1)+min;
	    }
		public static void dbg(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
		public static void reverse(int[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				int tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(int[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(long[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				long tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(long[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(float[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				float tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(float[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(double[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				double tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(double[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(char[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				char tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(char[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static <T> void reverse(T[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				T tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static <T> void reverse(T[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void shuffle(int[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            int t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(long[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            long t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(float[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            float t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(double[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            double t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(char[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            char t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static <T> void shuffle(T[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            T t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
		public static void sortArray(int[] a) {
	        shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(long[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(float[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(double[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(char[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static <T extends Comparable<T>> void sortArray(T[] a) {
	        Arrays.sort(a);
	    }
	}

static class Writer {
	private PrintWriter pw;
	public Writer(){
		pw = new PrintWriter(System.out);
	}

	public Writer(String f){
		try {
			pw = new PrintWriter(new FileWriter(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void printArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void printArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void print(Object o) {
		pw.print(o.toString());
	}
	public void println(Object o) {
		pw.println(o.toString());
	}
	public void println() {
		pw.println();
	}
	public void flush() {
		pw.flush();
	}
	public void exit() {
		pw.close();
	}
}
}


import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Random;
import java.io.FileWriter;
import java.io.PrintWriter;
/*
    Solution Created: 16:46:20 02/11/2020
    Custom Competitive programming helper.
*/

public class Main {
	public static void solve(Reader in, Writer out) {
		int t = in.nextInt();
		while(t-->0) {
			int n = in.nextInt();
			int cur = 4;
			out.print(4+" ");
			ArrayList<Integer> used = new ArrayList<Integer>();
			used.add(4);
			for(int i = 1; i<n; i++) {
				outer:
				while(true) {
					for(int k : used) {
						if(cur%k==0) {
							cur+=2;
							continue outer;
						}
					}
					break;
				}
				used.add(cur);
				out.print(cur+" ");
				cur+=2;
			}
			out.println();
		}
	}
	public static void main(String[] args) {
		Reader in = new Reader();
		Writer out = new Writer();
		solve(in, out);
		out.exit();
	}

static class Reader {
	static BufferedReader br;
	static StringTokenizer st;
	private int charIdx = 0;
	private String s;

	public Reader() {
		this.br = new BufferedReader(new InputStreamReader(System.in));
	}

	public Reader(String f){
		try {
			this.br = new BufferedReader(new FileReader(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public double[] nd(int n) {
		double[] a = new double[n];
		for (int i = 0; i < n; i++)
			a[i] = nextDouble();
		return a;
	}

	public char nextChar() {
		if (s == null || charIdx >= s.length()) {
			if (st == null || !st.hasMoreTokens())
				try {
					readLine();
				} catch (Exception e) {
				}
			s = st.nextToken();
			charIdx = 0;
		}
		return s.charAt(charIdx++);
	}

	public long[] nl(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}

	public char[] nca() {
		return next().toCharArray();
	}

	public String[] nS(int n) {
		String[] a = new String[n];
		for (int i = 0; i < n; i++)
			a[i] = next();
		return a;
	}

	public int nextInt() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Integer.parseInt(st.nextToken());
	}

	public double nextDouble() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Double.parseDouble(st.nextToken());
	}

	public Long nextLong() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Long.parseLong(st.nextToken());
	}

	public String next() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return st.nextToken();
	}

	public static void readLine() {
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
		}
	}
}

static class Util{
		private static Random random = new Random();

		public static long modInverse(long a, long MOD) {
			long[] gcdE = gcdExtended(a, MOD);
			if (gcdE[0] != 1) return -1; // Inverted doesn't exist
			long x = gcdE[1];
			return (x % MOD + MOD) % MOD;
		}
		public static long[] gcdExtended(long p, long q) {
			if (q == 0) return new long[] { p, 1, 0 };
			long[] vals = gcdExtended(q, p % q);
			long tmp = vals[2];
			vals[2] = vals[1] - (p / q) * vals[2];
			vals[1] = tmp;
			return vals;
		}
		public void fac(int n) {

		}
		public static boolean isPrime(int n) {
	        if (n <= 1) return false;
	        if (n <= 3) return true;
	        if (n % 2 == 0 || n % 3 == 0) return false;
	        for (int i = 5; i * i <= n; i = i + 6)
	            if (n % i == 0 || n % (i + 2) == 0)
	            return false;
	        return true;
	    }
	    public static int lowerBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int lowerBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int upperBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static int upperBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static boolean[] getSieve(int n) {
	        boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) isPrime[i] = true;
	        for (int i = 2; i*i <= n; i++) if (isPrime[i])
	                for (int j = i; i*j <= n; j++) isPrime[i*j] = false;
	        return isPrime;
	    }
	    public static int gcd(int a, int b) {
	    	int tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static long gcd(long a, long b) {
	    	long tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static int random(int min, int max) {
	    	return random.nextInt(max-min+1)+min;
	    }
		public static void dbg(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
		public static void reverse(int[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				int tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(int[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(long[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				long tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(long[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(float[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				float tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(float[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(double[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				double tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(double[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(char[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				char tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(char[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static <T> void reverse(T[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				T tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static <T> void reverse(T[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void shuffle(int[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            int t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(long[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            long t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(float[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            float t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(double[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            double t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(char[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            char t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static <T> void shuffle(T[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            T t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
		public static void sortArray(int[] a) {
	        shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(long[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(float[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(double[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(char[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static <T extends Comparable<T>> void sortArray(T[] a) {
	        Arrays.sort(a);
	    }
	}

static class Writer {
	private PrintWriter pw;
	public Writer(){
		pw = new PrintWriter(System.out);
	}

	public Writer(String f){
		try {
			pw = new PrintWriter(new FileWriter(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void printArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void printArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void print(Object o) {
		pw.print(o.toString());
	}
	public void println(Object o) {
		pw.println(o.toString());
	}
	public void println() {
		pw.println();
	}
	public void flush() {
		pw.flush();
	}
	public void exit() {
		pw.close();
	}
}
}


import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Random;
import java.io.FileWriter;
import java.io.PrintWriter;
/*
    Solution Created: 16:47:47 02/11/2020
    Custom Competitive programming helper.
*/

public class Main {
	public static void solve(Reader in, Writer out) {
		int t = in.nextInt();
		while(t-->0) {
			int n = in.nextInt();
			int cur = 4;
			out.print(4+" ");
			ArrayList<Integer> used = new ArrayList<Integer>();
			used.add(4);
			for(int i = 1; i<n; i++) {
				outer:
				while(true) {
					for(int k : used) {
						if(cur%k==0 || Util.gcd(cur, k)==1) {
							cur+=2;
							continue outer;
						}
					}
					break;
				}
				if(cur>4*n) throw new RuntimeException("d");
				used.add(cur);
				out.print(cur+" ");
				cur+=2;
			}
			out.println();
		}
	}
	public static void main(String[] args) {
		Reader in = new Reader();
		Writer out = new Writer();
		solve(in, out);
		out.exit();
	}

static class Reader {
	static BufferedReader br;
	static StringTokenizer st;
	private int charIdx = 0;
	private String s;

	public Reader() {
		this.br = new BufferedReader(new InputStreamReader(System.in));
	}

	public Reader(String f){
		try {
			this.br = new BufferedReader(new FileReader(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public double[] nd(int n) {
		double[] a = new double[n];
		for (int i = 0; i < n; i++)
			a[i] = nextDouble();
		return a;
	}

	public char nextChar() {
		if (s == null || charIdx >= s.length()) {
			if (st == null || !st.hasMoreTokens())
				try {
					readLine();
				} catch (Exception e) {
				}
			s = st.nextToken();
			charIdx = 0;
		}
		return s.charAt(charIdx++);
	}

	public long[] nl(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}

	public char[] nca() {
		return next().toCharArray();
	}

	public String[] nS(int n) {
		String[] a = new String[n];
		for (int i = 0; i < n; i++)
			a[i] = next();
		return a;
	}

	public int nextInt() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Integer.parseInt(st.nextToken());
	}

	public double nextDouble() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Double.parseDouble(st.nextToken());
	}

	public Long nextLong() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return Long.parseLong(st.nextToken());
	}

	public String next() {
		if (st == null || !st.hasMoreTokens())
			try {
				readLine();
			} catch (Exception e) {
			}
		return st.nextToken();
	}

	public static void readLine() {
		try {
			st = new StringTokenizer(br.readLine());
		} catch (Exception e) {
		}
	}
}

static class Util{
		private static Random random = new Random();

		public static long modInverse(long a, long MOD) {
			long[] gcdE = gcdExtended(a, MOD);
			if (gcdE[0] != 1) return -1; // Inverted doesn't exist
			long x = gcdE[1];
			return (x % MOD + MOD) % MOD;
		}
		public static long[] gcdExtended(long p, long q) {
			if (q == 0) return new long[] { p, 1, 0 };
			long[] vals = gcdExtended(q, p % q);
			long tmp = vals[2];
			vals[2] = vals[1] - (p / q) * vals[2];
			vals[1] = tmp;
			return vals;
		}
		public void fac(int n) {

		}
		public static boolean isPrime(int n) {
	        if (n <= 1) return false;
	        if (n <= 3) return true;
	        if (n % 2 == 0 || n % 3 == 0) return false;
	        for (int i = 5; i * i <= n; i = i + 6)
	            if (n % i == 0 || n % (i + 2) == 0)
	            return false;
	        return true;
	    }
	    public static int lowerBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int lowerBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(v<=a[mid]) h = mid;
	    		else l = mid+1;
	    	}
	    	return l;
	    }
	    public static int upperBound(int[] a, int v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static int upperBound(long[] a, long v) {
	    	int l = 0, h = a.length;
	    	while(l<h) {
	    		int mid = (l+h)/2;
	    		if(a[mid]<=v) l = mid+1;
	    		else h = mid;
	    	}
	    	return l;
	    }
	    public static boolean[] getSieve(int n) {
	        boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) isPrime[i] = true;
	        for (int i = 2; i*i <= n; i++) if (isPrime[i])
	                for (int j = i; i*j <= n; j++) isPrime[i*j] = false;
	        return isPrime;
	    }
	    public static int gcd(int a, int b) {
	    	int tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static long gcd(long a, long b) {
	    	long tmp = 0;
	    	while(b != 0) {
	    		tmp = b;
	    		b = a%b;
	    		a = tmp;
	    	}
	    	return a;
	    }
	    public static int random(int min, int max) {
	    	return random.nextInt(max-min+1)+min;
	    }
		public static void dbg(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
		public static void reverse(int[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				int tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(int[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(long[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				long tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(long[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(float[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				float tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(float[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(double[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				double tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(double[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void reverse(char[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				char tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static void reverse(char[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static <T> void reverse(T[] s, int l , int r) {
			for(int i = l; i<=(l+r)/2; i++) {
				T tmp = s[i];
				s[i] = s[r+l-i];
				s[r+l-i] = tmp;
			}
	    }
		public static <T> void reverse(T[] s) {
			reverse(s, 0, s.length-1);
	    }
		public static void shuffle(int[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            int t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(long[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            long t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(float[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            float t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(double[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            double t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static void shuffle(char[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            char t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
	    public static <T> void shuffle(T[] s) {
	        for (int i = 0; i < s.length; ++i) {
	            int j = random.nextInt(i + 1);
	            T t = s[i];
	            s[i] = s[j];
	            s[j] = t;
	        }
	    }
		public static void sortArray(int[] a) {
	        shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(long[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(float[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(double[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static void sortArray(char[] a) {
			shuffle(a);
	        Arrays.sort(a);
	    }
		public static <T extends Comparable<T>> void sortArray(T[] a) {
	        Arrays.sort(a);
	    }
	}

static class Writer {
	private PrintWriter pw;
	public Writer(){
		pw = new PrintWriter(System.out);
	}

	public Writer(String f){
		try {
			pw = new PrintWriter(new FileWriter(f));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void printArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(int[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void printArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
	}
	public void printlnArray(long[] a) {
		for(int i = 0; i<a.length; i++) print(a[i]+" ");
		pw.println();
	}
	public void print(Object o) {
		pw.print(o.toString());
	}
	public void println(Object o) {
		pw.println(o.toString());
	}
	public void println() {
		pw.println();
	}
	public void flush() {
		pw.flush();
	}
	public void exit() {
		pw.close();
	}
}
}


import java.io.*;
import java.util.*;

public class kidsseating {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("gymnastics.in"));
		PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("gymnastics.out")));
		StringTokenizer st = new StringTokenizer(br.readLine());

		int t=Integer.parseInt(st.nextToken());

		for(int i=1;i<=t;i++) {
			System.out.println();
			st=new StringTokenizer(br.readLine());
			int n=Integer.parseInt(st.nextToken());
			for(int j=4*n-2;j>=4*n-n*2;j--) {
				if(j%2==0) {
					System.out.print(j+" ");
				}
			}
		}
	}
}


import java.io.*;
import java.util.*;

public class kidsseating {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //BufferedReader br = new BufferedReader(new FileReader(".in"));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int t=Integer.parseInt(st.nextToken());

        for(int i=1;i<=t;i++) {
            System.out.println();
            st=new StringTokenizer(br.readLine());
            int n=Integer.parseInt(st.nextToken());
            for(int j=4*n-2;j>=4*n-n*2;j--) {
                if(j%2==0) {
                    System.out.print(j+" ");
                }
            }
        }
    }
}


import java.util.*;

public class codechef {
    private static Scanner sc = new Scanner(System.in);
    static int[] primes = new int[110];

    public static void main(String[] args) {
        int t = 0;
        int j = 0;
        for (int i = 2; j < 110; i++) {
            if (isPrime(i)) {
                primes[j++] = i;
            }
        }
        if (sc.hasNext())
            t = sc.nextInt();
        for (int i = 1; i <= t; i++) {
            solve();
        }

    }

    static boolean isPrime(int n) {
        if (n <= 1)
            return false;
        else if (n == 2)
            return true;
        else if (n % 2 == 0)
            return false;
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    public static void solve() {
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            System.out.print((primes[i]*2)+" ");

        }
        System.out.println();
    }
}


import java.util.*;

public class codechef {
    private static Scanner sc = new Scanner(System.in);
    static int[] primes = new int[110];

    public static void main(String[] args) {
        int t = 0;
        int j = 0;
        for (int i = 2; j < 110; i++) {
            if (isPrime(i)) {
                primes[j++] = i;
            }
        }
        if (sc.hasNext())
            t = sc.nextInt();
        for (int i = 1; i <= t; i++) {
            solve();
        }

    }

    static boolean isPrime(int n) {
        if (n <= 1)
            return false;
        else if (n == 2)
            return true;
        else if (n % 2 == 0)
            return false;
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    public static void solve() {
        int n = sc.nextInt();
        if (n == 1) {
            System.out.print(1);
        } else {
            for (int i = 0; i < n; i++) {
                System.out.print((primes[i] * 2) + " ");
            }
        }
        System.out.println();
    }
}


import java.util.*;

public class codechef {
    private static Scanner sc = new Scanner(System.in);
    static int[] primes = new int[110];

    public static void main(String[] args) {
        int t = 0;
        int j = 0;
        for (int i = 2; j < 110; i++) {
            if (isPrime(i)) {
                primes[j++] = i;
            }
        }
        if (sc.hasNext())
            t = sc.nextInt();
        for (int i = 1; i <= t; i++) {
            solve();
        }

    }

    static boolean isPrime(int n) {
        if (n <= 1)
            return false;
        else if (n == 2)
            return true;
        else if (n % 2 == 0)
            return false;
        for (int i = 3; i <= Math.sqrt(n); i += 2) {
            if (n % i == 0)
                return false;
        }
        return true;
    }

    public static void solve() {
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            System.out.print(primes[i]+" ");

        }
        System.out.println();
    }
}


#include<stdio.h>
int main()
{
    char n ,*arr , i,j;
    short int sum , total ;
    scanf("%d",&n);
    arr = calloc(n,sizeof(char));

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }

    for(i=0;i<n;i++)
    {
        for(j=i+1;i<n;j++)
        {
            if(arr[j]>arr[i])
            {
                char temp = arr[i];
                arr[i]==arr[j];
                arr[j]=temp;
            }
        }
    }

    for(i=0;i<n;i++)
    {sum +=arr[i];}

    for(i=0;i<n&&sum>=total;i++)
    {
        sum-=arr[i];
        total+=arr[i];
    }
    printf("%d",total);
}


#include<stdio.h>
int main()
{
    char n ,*arr , i,j;
    short int sum , total ;
    scanf("%d",&n);
    arr = calloc(n,sizeof(char));

    for(i=0;i<n;i++)
    {
        for(j=i+1;i<n;j++)
        {
            if(arr[j]>arr[i])
            {
                char temp = arr[i];
                arr[i]==arr[j];
                arr[j]=temp;
            }
        }
    }

    for(i=0;i<n;i++)
    {sum +=arr[i];}

    for(i=0;i<n&&sum>=total;i++)
    {
        sum-=arr[i];
        total+=arr[i];
    }
    printf("%d",total);
}


#include<stdio.h>
int main()
{
    char n ,arr[100] , i,j;
    short int sum=0 , total=0 ;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
        sum+=arr[i];
    }

    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(arr[j]>arr[i])
            {
                char temp = arr[i];
                arr[i]=arr[j];
                arr[j]=temp;
            }
        }
    }

    for(i=0;i<n&&sum>=total;i++)
    {
        sum-=arr[i];
        total+=arr[i];
    }
    printf("%d",i);
}


#include<stdio.h>
int main()
{
    char n ,arr[100] , i,j;
    short int sum=0 , total=0 ;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
        sum+=arr[i];

    }

    for(i=0;i<n;i++)
    {
        for(j=i+1;i<n;j++)
        {
            if(arr[j]>arr[i])
            {
                char temp = arr[i];
                arr[i]==arr[j];
                arr[j]=temp;
            }
        }
    }

    for(i=0;i<n&&sum>=total;i++)
    {
        sum-=arr[i];
        total+=arr[i];
    }
    printf("%d",total);
}


#include<stdio.h>
#include<string.h>
int arr[100];
int a,b,n,i,j,s,alinan,result,max = -100;
double sum = 0;

  int main(){

    scanf("%d",&n);

    for(i = 0; i < n; i++){  scanf("%d",&arr[i]);  sum += arr[i];  }

    while(alinan <= sum / 2){

        for(i = 0; i < n; i++)   if(arr[i] > max)   max = arr[i];

        for(i = 0 ; i < n; i++)  if(arr[i] == max)  arr[i] = 0;

        alinan += max;
        s++;
    }
    printf("%d",s);
    return 0;
  }


#include<stdio.h>
#include<string.h>
  int arr[100];

  int main(){
    int a,b,n,i,j,s = 1,alinan = 0,result = 0,sum = 0,max = -100;

     scanf("%d",&n);

    for(i = 0; i < n; i++)
       {
           scanf("%d",&arr[i]);
           sum += arr[i];
       }

    while(alinan <= sum / 2){

        for(i = 0; i < n; i++)
            if(arr[i] > max)
               max = arr[i];

        alinan += max;
        sum -= max;
        s++;
    }

    printf("%d",s);

    return 0;
  }


#include<stdio.h>
#include<string.h>
int arr[100];
int a,b,n,i,j,s,alinan,result,max = -100;
double sum;

  int main(){

    scanf("%d",&n);

    for(i = 0; i < n; i++){  scanf("%d",&arr[i]);  sum += arr[i];  }

    while(alinan <= sum / 2){

        for(i = 0; i < n; i++)   if(arr[i] > max)   max = arr[i];

        for(i = 0 ; i < n; i++)  if(arr[i] == max)  arr[i] = 0;

        alinan += max;
        s++;
    }
    printf("%d",s);
    return 0;
  }


#include<stdio.h>
#include<string.h>
  int arr[100];

  int main(){
    int a,b,n,i,j,s = 0,alinan = 0,result = 0,sum = 0,max = -100;

     scanf("%d",&n);

    for(i = 0; i < n; i++)
       {
           scanf("%d",&arr[i]);
           sum += arr[i];
       }

    while(alinan <= sum / 2){

        for(i = 0; i < n; i++)
            if(arr[i] > max)
               max = arr[i];

        for(i = 0 ; i < n; i++)
            if(arr[i] == max)
               arr[i] = 0;

        alinan += max;

        s++;
    }

    printf("%d",s);

    return 0;
  }


#include<stdio.h>
#include<string.h>
  int arr[100];

  int main(){
    int a,b,n,i,j,s = 0,alinan = 0,result = 0,sum = 0,max = -100;

     scanf("%d",&n);

    for(i = 0; i < n; i++)
       {
           scanf("%d",&arr[i]);
           if(arr[i] > max)
              max = arr[i];
           sum += arr[i];
       }

     sum += max;
    while(alinan <= sum / 2){

        for(i = 0; i < n; i++)
            if(arr[i] > max)
               max = arr[i];

        for(i = 0 ; i < n; i++)
            if(arr[i] == max)
               arr[i] = 0;

        alinan = max;
        sum -= max;

        s++;
    }

    printf("%d",s);

    return 0;
  }


#include<stdio.h>
#include<string.h>
int arr[100];
int a,b,n,i,j,s,alinan,result,max = -100,flag;
double sum = 0;

  int main(){

    scanf("%d",&n);

    for(i = 0; i < n; i++){  scanf("%d",&arr[i]); sum += arr[i];  }

    while(alinan <= sum / 2){

        for(i = 0; i < n; i++)
            if(arr[i] > max)
               {
                max = arr[i];
                flag = i;
               }
        arr[flag] = 0;
        alinan += max;
        s++;
        max = 0;
    }

    printf("%d",s);
    return 0;
  }


#include<stdio.h>
#include<string.h>
  int arr[100];

  int main(){
    int a,b,n,i,j,s = 0,durum = 0,result = 0,sum = 0;

     scanf("%d",&n);

     for(i = 1 ; i <= n ; i++)
        {
         scanf("%d",&arr[i]);
         sum += arr[i];
        }

     if(n % 2 == 0)
        result = sum / 2 - 1;
     else
        result = sum / 2;

     printf("%d",result);

    return 0;
  }


#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int n , i , x = 0 , j , sum1 = 0 , sum2 = 0;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
	{
		sum1 = sum1 + a[i];

		for(j=i+1;j<n;j++)
		{
			sum2 = sum2 + a[j] ;
		}

		if(sum1 > sum2)
		{
			printf("%d",i+1);
			break;
		}
		sum2 = 0;
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int n , i ,j ,  x = 0  , sum = 0 , temp , z;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum = sum + a[i];
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{

			if(a[j]>a[j+1])
			{
				temp = a[j];
				a[j]= a[j+1];
				a[j+1] = temp;
			}
		}
	}

	z = 0 ;
	for(i=n-1;i>=0;i--)
	{
		if(x<=sum)
		{
			x = x + a[i] ;
			z++;
		}

		sum = sum - x ;
		 if(x>sum)
		{

			printf("%d",z);
			return 0 ;
		}
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int n , i ,j ,  x = 0  , sum = 0 , temp , z;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum = sum + a[i];
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			if(a[j]>a[j+1])
			{
				temp = a[j];
				a[j]= a[j+1];
				a[j+1] = temp;
			}
		}
	}

	z = 0 ;
	for(i=n-1;i>=0;i++)
	{
		sum = sum - x ;
		if(x>sum)
		{
			printf("%d",z);
			return 0 ;
		}
		else if(x<sum)
		{
			x = x + a[i] ;
			z++;
		}

	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int n , i ,j ,  x = 0  , sum = 0 , temp , z;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum = sum + a[i];
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{

			if(a[j]>a[j+1])
			{
				temp = a[j];
				a[j]= a[j+1];
				a[j+1] = temp;
			}
		}
	}

	z = 0 ;
	for(i=n-1;i>=0;i--)
	{
		if(x<=sum)
		{
			x = x + a[i] ;  // 4  6
			z++;            // 1  1
		}

		sum = sum - a[i];     // 8
		 if(x>sum)
		{

			printf("%d",z);
			return 0 ;
		}
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
	int n , i ,j ,  x = 0  , sum = 0 , temp , z;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum = sum + a[i];
	}
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{

			if(a[j]>a[j+1])
			{
				temp = a[j];
				a[j]= a[j+1];
				a[j+1] = temp;
			}
		}
	}

	z = 0 ;
	for(i=n-1;i>=0;i--)
	{

		sum = sum - x ;
		if(x>sum)
		{
			printf("%d",z);
			return 0 ;
		}
		else if(x<=sum)
		{
			x = x + a[i] ;
			z++;
		}
	}
	return 0;
}


#include <stdio.h>
int n[101],num,i,sum = 0,j = 0,took = 0;
int main(){
scanf("%d",&num);
for(i = 0;i < num;i++){
scanf("%d",&n[i]);
sum += n[i];
}
sum /= 2;
for(i = 0;i <num;i++){
if(n[i] + j <= sum)
{
j += n[i];
took++;
}
else
{
j += n[i];
took++;
break;
}
}
printf("%d",took);
return 0;
}


#include <stdio.h>
#include <stdlib.h>
int c,max,index;
int find_maximum(int a[], int n){
  max = a[0];
  index = 0;
  for (c = 1; c < n; c++) {
    if (a[c] > max) {
       index = c;
       max = a[c];
    }
  }
return max;
}
int n[101],num,max,i,sum = 0,sum2 = 0,took = 0;
int main(){
scanf("%d",&num);
for(i = 0;i < num;i++){
scanf("%d",&n[i]);
sum += n[i];
}
sum /= 2;
for(i = 0;i <num;i++){
find_maximum(n,num);
n[index] = -1;
if(max + sum2 <= sum)
{
sum2 += max;
took++;
}
else
{
sum2 += max;
took++;
break;
}
}
printf("%d",took);
return 0;
}


#include <stdio.h>
#include <stdlib.h>
int n[101],t,num,max =0,i,sum = 0,x,j = 0,took = 0,l;
int main(){
scanf("%d",&num);
for(i = 0;i < num;i++){
scanf("%d",&n[i]);
sum += n[i];
}
sum /= 2;
for(i = 0;i <num;i++){
for(x = 0;x < num;x++){
if(n[x] > max)
max = n[x];
if(x == num-1)
{
for(t = x;t >= 0;t--){
if(n[t] == max)
n[t] = -1;
}
}
}
if(max + j <= sum)
{
j += max;
took++;
}
else
{
j += n[i];
took++;
break;
}
}
for(i = 0;i < took;i++){
if(j - n[i] > sum){
j -= n[i];
l++;
}
}
took -= l;
printf("%d",took);
return 0;
}


#include <stdio.h>
#include <stdlib.h>
int n[101],t,num,max =0,i,sum = 0,x,j = 0,took = 0,l;
int main(){
scanf("%d",&num);
for(i = 0;i < num;i++){
scanf("%d",&n[i]);
sum += n[i];
}
sum /= 2;
for(i = 0;i <num;i++){
for(x = 0;x < num;x++){
if(n[x] > max)
max = n[x];
if(x == num-1)
{
for(t = x;t >= 0;t--){
if(n[t] == max)
n[t] = -1;
}
}
}
if(max + j <= sum)
{
j += max;
took++;
}
else
{
j += n[i];
took++;
break;
}
}

printf("%d",took);
return 0;
}


#include <stdio.h>
int n[101],num,i,sum = 0,j = 0,took = 0,l;
int main(){
scanf("%d",&num);
for(i = 0;i < num;i++){
scanf("%d",&n[i]);
sum += n[i];
}
sum /= 2;
for(i = 0;i <num;i++){
if(n[i] + j <= sum)
{
j += n[i];
took++;
}
else
{
j += n[i];
took++;
break;
}
}
for(i = 0;i < took;i++){
if(j - n[i] > sum){
j -= n[i];
l++;
}
}
took -= l;
printf("%d",took);
return 0;
}


#include <stdio.h>
#include <stdlib.h>
int find_maximum(int a[], int n) {
  int c, max, index;

  max = a[0];
  index = 0;

  for (c = 1; c < n; c++) {
    if (a[c] > max) {
       index = c;
       max = a[c];
    }
  }

return max;
}
int n[101],num,max,i,sum = 0,j = 0,took = 0,l;
int main(){
scanf("%d",&num);
for(i = 0;i < num;i++){
scanf("%d",&n[i]);
sum += n[i];
}
sum /= 2;
for(i = 0;i <num;i++){
find_maximum(n,num);
if(n[i] > max)
if(n[i] + j <= sum)
{
j += n[i];
took++;
}
else
{
j += n[i];
took++;
break;
}
}
for(i = 0;i < took;i++){
if(j - n[i] > sum){
j -= n[i];
l++;
}
}
took -= l;
printf("%d",took);
return 0;
}


#include<stdio.h>

int main ()

{
    int n,i;
    scanf("%d",&n);

    int arr[n];

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }

   {printf("%d",(n/2)+1);}
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=1,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}
	max=n[0];

  for (i = 0 ; i < ( number - 1 ); i++){
    for (j = 0 ; j < number - i - 1; j++){
      if (n[j] <=n[j+1]){
        temp=n[j];
        n[j]   = n[j+1];
        n[j+1] =temp;
      }
    }
  }
  max_sum=n[0];
  min_sum=sum;
while(max_sum<=min_sum){
		max_sum=max_sum+n[j+1];
		count++;
		min_sum=sum-max_sum;
		sum=min_sum;

}
	printf("%d",count);
return 0;
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=1,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}
	max=n[0];

  for (i = 0 ; i < ( number - 1 ); i++){
    for (j = 0 ; j < number - i - 1; j++){
      if (n[j] <=n[j+1]){
        temp=n[j];
        n[j]   = n[j+1];
        n[j+1] =temp;
      }
    }
  }
  max_sum=n[0];
  min_sum=sum;

while(max_sum<=min_sum){
	if(number==1)
		break;
	max_sum=max_sum+n[j+1];
	count++;
	min_sum=sum-max_sum;
	sum=min_sum;

}
	printf("%d",count);
return 0;
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=0,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}

	max=n[0];

	while(max_sum<=min_sum){
		for(j=0;j<number;j++){
			if(max<=n[j+1]){
				temp=max;
				max=n[j+1];
				n[j+1]=temp;
				max_sum=+max;
				count++;
				min_sum=sum-max_sum;
				sum=min_sum;

			}

		}

	}
	printf("%d",count);
return 0;
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=1,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}
	max=n[0];

  for (i = 0 ; i < ( number - 1 ); i++){
    for (j = 0 ; j < number - i - 1; j++){
      if (n[j] <=n[j+1]){
        temp=n[j];
        n[j]   = n[j+1];
        n[j+1] =temp;
      }
    }
  }
  max_sum=n[0];
  min_sum=sum;
while(max_sum<min_sum){
		max_sum=max_sum+n[j+1];
		count++;
		min_sum=sum-max_sum;
		sum=min_sum;

}
	printf("%d",count);
return 0;
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=0,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}
  for (i = 0 ; i < ( number - 1 ); i++){
    for (j = 0 ; j < number - i - 1; j++){
      if (n[j] <=n[j+1]){
        temp=n[j];
        n[j]   = n[j+1];
        n[j+1] =temp;
      }
    }
  }
  max_sum=0;
  min_sum=sum;
for(j=0;j<number;j++){
	if(max_sum<=min_sum){
		max_sum=max_sum+n[j];
	//	printf("%d",n[j]);
		count++;
		min_sum=sum-max_sum;
		//sum=min_sum;
		}
		else

			break;
}
	printf("%d",count);
return 0;
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=0,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}
  for (i = 0 ; i < ( number - 1 ); i++){
    for (j = 0 ; j < number - i - 1; j++){
      if (n[j] <=n[j+1]){
        temp=n[j];
        n[j]   = n[j+1];
        n[j+1] =temp;
      }
    }
  }
  max_sum=0;
  min_sum=sum;
for(j=0;j<number;j++){
	if(max_sum<=min_sum){
		max_sum=max_sum+n[j];
	//	printf("%d",n[j]);
		count++;
		min_sum=sum-max_sum;
		sum=min_sum;
		}
		else

			break;
}
	printf("%d",count);
return 0;
}


#include<stdio.h>
int main (){
	int number,i,n[100],sum=0,j,max, count=0,temp;
	int max_sum=0,min_sum=0;
	scanf("%d",&number);

	for(i=0;i<number;i++){
		scanf("%d",&n[i]);
		sum=sum+n[i];

	}

	max=n[0];

	while(max_sum<=min_sum){
		for(j=0;j<number;j++){
			if(max<n[j]){
				temp=max;
				max=n[j];
				n[j]=temp;
			}
		}
		max_sum=+max;
		count++;
		min_sum=sum-max_sum;
		sum=min_sum;
	}
	printf("%d",count);
return 0;
}


#include<stdio.h>
#define MAX 101
int comp(const void*p, const void*q) {
	return *(int*)q - *(int*)p;
}
int main() {
	int namount, ncount=0;
	int m[MAX],sum=0,sum1=0;
	int i;
	scanf("%d", &namount);
	for (i = 0; i < namount;i++){
		scanf("%d", &m[i]);
		sum += m[i];
	}
	qsort(m, namount, sizeof(int), comp);
	for (i = 0; i < namount; i++) {
		sum1 += m[i];
		ncount++;
		if (sum1 > sum / 2)
			break;
	}
	printf("%d\n", ncount);
	return 0;
}


#include<stdio.h>

int main()
{
	int n;
	int a[101];
	int i,j,temp;
	float sum=0;
	int num=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum +=a[i];
	}
	for(i=1;i<n;i++)
	{
		for(j=0;j<n-i;j++)
		{
			if(a[j]>a[j+1])
			{
				temp=a[j+1];
				a[j+1]=a[j];
				a[j]=temp;
			}

		}
	}
	for(i=n-1;num<=sum/2;i--)
	{
		num +=a[i];
	}
	printf("%d",n-i-1);

	return 0;

}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,a[100],i;
	cin>>n;
	int b=0;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
		b+=a[i];
	}
	sort(a,a+n);
	int c=0;
	for(int d=i-1;;d--)
	{
    	c=c+a[d];
    	if(c>(b/2))
    	{
    		cout<<i-d;
    		break;
    	}
    	else
    		continue;
	}
	return 0;
 }


#include<stdio.h>
#include<stdlib.h>

int cmp(const void *p, const void *q)
{
	return *(int *)q - *(int *)p;
}

int main()
{
	int n;
	int cnt = 0;
	int re = 0;
	int i, sum = 0, list[100];
	while(scanf("%d", &n) != EOF)
	{
		cnt = 0;
		re = 0;
		sum = 0;
		for(i = 0 ; i < n; i++)
		{
			scanf("%d", &list[i]);
			sum += list[i];
		}

		qsort(list, n, sizeof(int), cmp);

		for(i = 0 ; i < n ; i++)
		{
				cnt++;
			re += list[i];
			sum -= list[i];
			if(re > sum)
				break;
		}

		printf("%d\n", cnt);
	}

	return 0;
}


#include<stdio.h>

int main()
{
	int n;
	int a[101];
	int i,j,temp;
	float sum=0;
	int num=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum +=a[i];
	}
	for(i=1;i<n;i++)
	{
		for(j=0;j<n-i;j++)
		{
			if(a[j]>a[j+1])
			{
				temp=a[j+1];
				a[j+1]=a[j];
				a[j]=temp;
			}

		}
	}
	for(i=0;num<=sum/2;i++)
	{
		num +=a[i];
	}
	printf("%d",i);

	return 0;

}


# include <stdio.h>
# include <stdlib.h>
int comp(const void *a,const void *b)
{
	return *(int *)b-*(int *)a;
}
int main ()
{
	int a[105];
	int n, sum=0, sum2=0, mark=1, i;
	scanf("%d",&n);
	for( i=0;i<n;i++)
		scanf("%d",&a[i]);
	qsort(a,n,sizeof(int),comp);
	for(i=0;i<n;i++)
		sum+=a[i];
	for(i=0;i<n;i++)
	{
		if((sum2+a[i])>0.5*sum)
			break;
		else
		{
			mark++;
			sum2+=a[i];
		}
	}
	printf("%d\n",mark);
	return 0;
}


#include<stdio.h>
int main(){
	int n,temp,sum=0,suma=0,a[101],count=0,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	scanf("%d",&a[i]);
		sum+=a[i];
		}
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			if(a[i]<a[j]){
				temp=a[j];
				a[j]=a[i];
				a[i]=temp;
			}
		}
	}//从大到小排序
	for(i=0;i<n;i++){
		suma+=a[i];
		count++;
		if(2*suma>sum){
			printf("%d\n",count);
			break;
		}
	}
	return 0;
}


#include<stdio.h>
#include<math.h>

int a[100];
void sort(int n)
{
    int i,j;
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
            if(a[i]<a[j]) a[i] ^= a[j] ^= a[i] ^= a[j];
}
int main()
{
    int n,i,j,m=0,sum1=0,sum2=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    sort(n);
    for(i=0;i<n;i++){
        sum1+=a[i];
    }
    for(i=0;i<n;i++){
        sum1+=a[i];
        m++;
        if(sum2>sum1) break;
    }
    printf("%d",m);
    return 0;
}


#include<stdio.h>
#include<math.h>

int a[100];
void sort(int n)
{
    int i,j;
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
            if(a[i]<a[j]) a[i] ^= a[j] ^= a[i] ^= a[j];
}
int main()
{
    int n,i,j,m,sum1=0,sum2=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    sort(n);
    if(n%2==0) m=n/2;
    else m=n/2+1;
    for(i=0,j=n-1;i<m;i++,j--){
        sum1+=a[i];
        sum2+=a[j];
    }
    if(sum1>sum2){
        printf("%d",m);
        return 0;
    }
    else {
        while(m<=n){
            sum1+=a[m];
            sum2-=a[m];
            m++;
            if(sum1>sum2){
                printf("%d",m);
                return 0;
            }
        }
    }
    return 0;
}


#include<stdio.h>
#include<math.h>

int a[100];
void sort(int n)
{
    int i,j;
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
            if(a[i]<a[j]) a[i] ^= a[j] ^= a[i] ^= a[j];
}
int main()
{
    int n,i,j,m,sum1=0,sum2=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    sort(n);
    if(n%2==0) m=n/2;
    else m=n/2+1;
    for(i=0,j=n-1;i<m;i++,j--){
        sum1+=a[i];
        sum2+=a[j];
    }
    if(sum1>sum2){
        printf("%d %d",sum1,sum2);
        return 0;
    }
    else {
        while(m<=n){
            sum1+=a[m];
            sum2-=a[m];
            m++;
            if(sum1>sum2){
                printf("%d",m);
                return 0;
            }
        }
    }
    return 0;
}


#include<stdio.h>
#include<math.h>

int a[100];
void sort(int n)
{
    int i,j;
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
            if(a[i]<a[j]) a[i] ^= a[j] ^= a[i] ^= a[j];
}
int main()
{
    int n,i,j,m=0,sum1=0,sum2=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum1+=a[i];
    }

    sort(n);
    sum1/=2;
    for(i=0;i<n;i++){
        sum2+=a[i],m++;
        if(sum2>sum1) break;

    }
    printf("%d",m);
    return 0;
}


#include<stdio.h>
#include<math.h>

int a[100];
void sort(int n)
{
    int i,j;
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
            if(a[i]<a[j]) a[i] ^= a[j] ^= a[i] ^= a[j];
}
int main()
{
    int n,i,j,m=0,sum1=0,sum2=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum1+=a[i];
    }

    sort(n);
    for(i=0;i<n;i++){
        if(sum2>sum1) break;
        sum2+=a[i],m++;
    }
    printf("%d",m);
    return 0;
}


#include<stdio.h>
int main(void)
{
	int n,i,sum=0,pass,temp,s=0;
	int a[120];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum+=a[i];
	}
	for(pass=1;pass<n;pass++)
	{
		for(i=0;i<n-pass;i++)
		{
			if(a[i]<a[i+1])
			{
				temp=a[i];
				a[i]=a[i+1];
				a[i+1]=temp;
			}
		}
	}
	for(i=0;s<=sum*1.0/2;i++)
	{
		s=s+a[i];
	}
	printf("%d\n",i);
	return 0;
}


#include<stdio.h>

int main()
{
	int n;
	int a[101];
	int i,j,temp;
	float sum=0;
	int num=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum +=a[i];
	}
	for(i=1;i<n;i++)
	{
		for(j=0;j<n-i;j++)
		{
			if(a[j]>a[j+1])
			{
				temp=a[j+1];
				a[j+1]=a[j];
				a[j]=temp;
			}

		}
	}
	for(i=n-1;num<=sum/2;i--)
	{
		num +=a[i];
	}
	printf("%d",i);

	return 0;

}