There are n models in the shop numbered from 1 to n, with sizes s_1, s_2, …, s_n.

Orac will buy some of the models and will arrange them in the order of increasing numbers (i.e. indices, but not sizes).

Orac thinks that the obtained arrangement is beatiful, if for any two adjacent models with indices i_j and i_{j+1} (note that i_j < i_{j+1}, because Orac arranged them properly), i_{j+1} is divisible by i_j and s_{i_j} < s_{i_{j+1}}.

For example, for 6 models with sizes \{3, 6, 7, 7, 7, 7\}, he can buy models with indices 1, 2, and 6, and the obtained arrangement will be beautiful. Also, note that the arrangement with exactly one model is also considered beautiful.

Orac wants to know the maximum number of models that he can buy, and he may ask you these queries many times.

Input

The first line contains one integer t\ (1 ≤ t≤ 100): the number of queries.

Each query contains two lines. The first line contains one integer n\ (1≤ n≤ 100 000): the number of models in the shop, and the second line contains n integers s_1,...,s_n\ (1≤ s_i≤ 10^9): the sizes of models.

It is guaranteed that the total sum of n is at most 100 000.

Output

Print t lines, the i-th of them should contain the maximum number of models that Orac can buy for the i-th query.

Example

Input


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


Output


2
3
1
1

Note

In the first query, for example, Orac can buy models with indices 2 and 4, the arrangement will be beautiful because 4 is divisible by 2 and 6 is more than 3. By enumerating, we can easily find that there are no beautiful arrangements with more than two models. 

In the second query, Orac can buy models with indices 1, 3, and 6. By enumerating, we can easily find that there are no beautiful arrangements with more than three models. 

In the third query, there are no beautiful arrangements with more than one model.


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

import static java.lang.Math.*;

public class Contest {
    public static class pair implements Comparable<pair> {
        int u;
        long val;

        public pair(int a, long value) {
            u = a;
            val = value;
        }

        @Override
        public int compareTo(pair p) {
            return Long.compare(val, p.val);
        }
    }

    static int n, m;
    static ArrayList<Integer>[] adj;
    static int dist[];
    static int parent[];
    static long inf = (long) 1e16;
    static int INF = (int) 1e9;

    public static int[] bfs(int s) {
        dist = new int[n];
        Arrays.fill(dist, -1);
        dist[s] = 0;
        Queue<Integer> q = new LinkedList<>();
        q.add(s);
        while (!q.isEmpty()) {
            int u = q.poll();
            for (int v : adj[u])
                if (dist[v] == -1) {
                    dist[v] = dist[u] + 1;
                    q.add(v);
                }
        }
        return dist;
    }

    public static long calc(long[] acc, int single, int Dbl) {
        if (single + Dbl > m) return inf;
        return acc[Dbl] + acc[single + Dbl];
    }

    public static boolean subset(TreeSet<Integer> small, TreeSet<Integer> big) {
        for (int x : small)
            if (!big.contains(x))
                return false;
        return true;
    }

    public static TreeSet<Integer> subset2(TreeSet<Integer> small, TreeSet<Integer> big) {
        TreeSet<Integer> ts = new TreeSet<>();
        for (int x : small)
            if (!big.contains(x))
                ts.add(x);
        return ts;
    }

    public static boolean CanBeStart(int x, TreeSet<Integer>[] Arr) {
        TreeSet<Integer> last = new TreeSet<>();
        for (int j = 0; j < n - 1; j++)
            if (Arr[j].contains(x)) {
                if (!subset(last, Arr[j]))
                    return false;
                last = Arr[j];
            }
        return true;
    }

    public static boolean check(TreeSet<Integer> sublist, ArrayList<Integer> arr) {
        int len = sublist.size(), n = arr.size();
        for (int i = 0; i < n - len + 1; i++) {
            boolean flag = true;
            for (int j = 0; j < len; j++)
                if (!sublist.contains(arr.get(i + j)))
                    flag = false;
            if (flag) return true;
        }
        return false;
    }

    public static boolean check(TreeSet<Integer>[] Arr, ArrayList<Integer> arr) {
        boolean ans = true;
        for (int i = 0; i < n - 1; i++)
            ans &= check(Arr[i], arr);
        return ans;
    }

    public static boolean alltrue(boolean[] arr) {
        for (boolean flag : arr)
            if (flag) return false;
        return true;
    }

    public static boolean sep(boolean[] arr) {
        boolean open = false;
        int cnt = 0;
        for (int i = 0; i < arr.length; i++)
            if (open) {
                if (!arr[i]) open = false;
            } else {
                if (arr[i]) {
                    open = true;
                    cnt++;
                }
            }
        return cnt <= 1;
    }


    static int[] dx = new int[]{-1, 1, 0, 0};
    static int[] dy = new int[]{0, 0, -1, 1};
    static boolean[][] Matrix, vis;

    static boolean valid(int i, int j) {
        return i != -1 && j != -1 && i != n && j != m && Matrix[i][j];
    }

    static void dfs2(int i, int j) {
        vis[i][j] = true;                        //mark as visited
        for (int k = 0; k < 4; ++k) {
            int x = i + dx[k], y = j + dy[k];
            if (valid(x, y) && !vis[x][y])
                dfs2(x, y);
        }
    }

    public static boolean isSimilar(char[] Arr, int s, int k) {
        for (int i = s; i < k - 1; i++) {
            if (Arr[i + 1] != Arr[i])
                return false;
        }
        return true;
    }

    public static int ciel(int d, int mod) {
        if (d % mod == 0)
            return d / mod;
        return d / mod + 1;
    }

    public static long lcm(long u, long v) {
        return (v / gcd(u, v)) * u;
    }

    public static long gcd(long u, long v) {
        if (v == 0)
            return u;
        return gcd(v, u % v);
    }

    public static void calc(int idx, int v, int[] arr) {
        for (int x : arr)
            pw.print(x + idx * v + " ");

    }

    static int[] four = new int[]{2, 4, 1, 3};
    static int[] five = new int[]{1, 4, 2, 5, 3};
    static int[] six = new int[]{1, 4, 2, 6, 3, 5};
    static int[] seven = new int[]{1, 5, 3, 6, 2, 4, 7};
    static PrintWriter pw;

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            long[] Arr = new long[n + 1];
            for (int i = 1; i <= n; i++) Arr[i] = sc.nextInt();
            long[] dp = new long[n + 1];
            Arrays.fill(dp,1);
            for (int i = n; i > 0; i--)
                for (long j = i*2; j <= n; j+=i)
                    if ( Arr[(int) j] > Arr[i])
                            dp[i]=max(dp[(int) j]+1,dp[i]);
            long ans=0;
            for (int i = 1; i <= n; i++){
                ans=max(ans,dp[i]);
            }
            pw.println(ans);

        }


        pw.close();

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException, IOException {
            return br.ready();
        }

    }
}
