Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 406 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 16 Sep 2017 My Price 7.00

largest sub-array

Problem Description

 

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.

Input Format

    • 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.

Output Format

      • For each query, output a single line containing the answer for that query.

Constraints

      • 1 = T = 10
      • 1 = n = 10^4
      • 1 A[i] = 10^9
      • 1 = q = 2*10^5
      • x 10^9

 

Example

Input:

1 3 2 4 5 3 2 5 3

Output:

2
1
0

Answers

(5)
Status NEW Posted 16 Sep 2017 12:09 PM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)