Polycarp has n friends, the i-th of his friends has a_i candies. Polycarp's friends do not like when they have different numbers of candies. In other words they want all a_i to be the same. To solve this, Polycarp performs the following set of actions exactly once: 

  * Polycarp chooses k (0 ≤ k ≤ n) arbitrary friends (let's say he chooses friends with indices i_1, i_2, …, i_k); 
  * Polycarp distributes their a_{i_1} + a_{i_2} + … + a_{i_k} candies among all n friends. During distribution for each of a_{i_1} + a_{i_2} + … + a_{i_k} candies he chooses new owner. That can be any of n friends. Note, that any candy can be given to the person, who has owned that candy before the distribution process. 



Note that the number k is not fixed in advance and can be arbitrary. Your task is to find the minimum value of k.

For example, if n=4 and a=[4, 5, 2, 5], then Polycarp could make the following distribution of the candies: 

  * Polycarp chooses k=2 friends with indices i=[2, 4] and distributes a_2 + a_4 = 10 candies to make a=[4, 4, 4, 4] (two candies go to person 3). 



Note that in this example Polycarp cannot choose k=1 friend so that he can redistribute candies so that in the end all a_i are equal.

For the data n and a, determine the minimum value k. With this value k, Polycarp should be able to select k friends and redistribute their candies so that everyone will end up with the same number of candies.

Input

The first line contains one integer t (1 ≤ t ≤ 10^4). Then t test cases follow.

The first line of each test case contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5).

The second line contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 10^4).

It is guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case output: 

  * the minimum value of k, such that Polycarp can choose exactly k friends so that he can redistribute the candies in the desired way; 
  * "-1" if no such value k exists. 

Example

Input


5
4
4 5 2 5
2
0 4
5
10 8 5 1 4
1
10000
7
1 1 1 1 1 1 1


Output


2
1
-1
0
0


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Random;



// by ts_22
// FRIENDS AND CANDIES


public class codeforce1 {

//	static boolean minC=false;
//	static boolean maxC=false;
    final long MOD = (long) 1e9 + 7;

    final  StringBuilder ans = new StringBuilder();

     final  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) throws java.lang.Exception{
        try {
           // long startTime = System.currentTimeMillis();

             FastReader fr = new FastReader(System.in);
             FastPrinter fp = new FastPrinter(System.out);

//            q1 solver = new q1();

            int test = fr.nextInt();
            while (test-- > 0) {
            int N=fr.nextInt();
            	int arr[]=fr.nextIntArray(N);
            	int sum=0,k=0,i;
            	for(i=0;i<N;i++)
            	{
            		sum+=arr[i];
            	}
            	if(sum%N==0)
            	{
	            	for(i=0;i<N;i++)
		            	{
		            		if(sum/N<arr[i])
		            			k++;
		            	}
            	}
            	else
            		k=-1;
            	fp.println(k);
            }
            
            
            
//            long endTime = System.currentTimeMillis();
//            if (System.getProperty("ONLINE_JUDGE") == null) {
//            fp.println("Time: " + (endTime - startTime) + " ms");
//            }
            
            fp.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
  
    
    
    
    
}
    class FastPrinter {
        final private PrintWriter out;

        FastPrinter(OutputStream out) {
            this.out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out)));
        }

        public void printlnArray(int[] arr) {
            for (int i : arr) {
                out.println(i);
            }
        }

        public void printlnArray(long[] arr) {
            for (long i : arr) {
                out.println(i);
            }
        }

        public void printArray(int[] arr) {
            for (int i : arr) {
                out.print(i + " ");
            }
            out.println();
        }

        public void printArray(long[] arr) {
            for (long i : arr) {
                out.print(i + " ");
            }
            out.println();
        }

        public void println() {
            out.println();
        }

        public void println(String s) {
            out.println(s);
        }

        public void println(int s) {
            out.println(s);
        }

        public void println(long s) {
            out.println(s);
        }

        public void println(double s) {
            out.println(s);
        }

        public void println(Object a) {
            out.println(a);
        }

        public void print(String s) {
            out.print(s);
        }

        public void print(Object a) {
            out.print(a);
        }

        public void flush() {
            out.flush();
        }

        public void close() {
            out.close();
        }
}  
    
    class FastReader {
        final private int BUFFER_SIZE = 1 << 17;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public FastReader(InputStream in) {
            din = new DataInputStream(in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public FastReader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();

            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');

            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        public int[] nextIntArray(int size) throws IOException {
            int[] arr = new int[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int size) throws IOException {
            long[] arr = new long[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public int[][] nextIntMatrix(int n, int m) throws IOException {
            int[][] arr = new int[n][m];
            for (int i = 0; i < n; i++) {
                arr[i] = nextIntArray(m);
            }
            return arr;
        }

        public long[][] nextLongMatrix(int n, int m) throws IOException {
            long[][] arr = new long[n][m];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLongArray(m);
            }
            return arr;
        }

        public ArrayList<Integer> nextIntList(int size) throws IOException {
            ArrayList<Integer> arrayList = new ArrayList<>(size);
            for (int i = 0; i < size; i++) {
                arrayList.add(nextInt());
            }
            return arrayList;
        }

        public ArrayList<Long> nextLongList(int size) throws IOException {
            ArrayList<Long> arrayList = new ArrayList<>(size);
            for (int i = 0; i < size; i++) {
                arrayList.add(nextLong());
            }
            return arrayList;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }


    }

            
            
            
            
            
            