Subarray

3.3

11 votes
Easy-Medium
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 conatin number of test cases T. Each test case contain number of element in array N.Next line contain elements of array.

OUTPUT

print maximum length of subarray

Constraints

1<=T<=100 1<=N<=1000000 1<=a[i]<=1000000

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

Subarray of maximum length conatins 5 10 20

Editor Image

?