Easy Task

3.8

27 votes
Problem

Here is your task. You are given an array and you have to find the maximum possible length of subarray In that subarray a[i+1]%a[i]==0

Every element in subarray is divisible by its previous element. Your task is to find maximum length of subarray.

INPUT

First line conatins number of test cases T. Each test case contains number of element in array N.Next line contains elements of array.

OUTPUT

Print maximum length of subarray .

Constraints

1<=T<=100

1<=N<=1000000

1<=elements<=1000000

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Subarray of maximum length conatins 5 10 20

Editor Image

?