Prime and its multiples
All submissions for this problem are available.
You are given n integers.You are also given another integer x which is prime.
Now your task is simple.
You have to find the length of the largest sub-array,in which all the elements are divisible by x.
- The first line of the input contains an integer T denoting the number of test cases. Then it is followed by T cases.
- The first line of each test case contains an integer n denoting the number of elements in the array. Then it is followed by n space separated integers.
- Then the next line of the input contains an integer q denoting the number of queries.Then q lines follow each having a prime number.
- For each query, output a single line containing the answer for that query.
- 1 ≤ T ≤ 10
- 1 ≤ n ≤ 10^4
- 1 < A[i] ≤ 10^9
- 1 ≤ q ≤ 2*10^5
- x < 10^9
1 3 2 4 5 3 2 5 3Output:
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions