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: 398 Weeks Ago, 5 Days 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 17 Sep 2017 My Price 7.00

gcd of numbers

We all know that our friend Bheem likes gcd of numbers very much. One day Kaalia challenged him with a new problem with gcd. He gave Bheem N numbers and asked to divide the given set of numbers into some disjoint subsequences. Two numbers a and b belong to same subsequence if gcd(a,b)>1. Value of each subsequence is the largest number in that subsequence. He challenged Bheem to find the product of values of all subsequences.
Help Bheem win this challenge.
Note: if gcd(a,b) >1, gcd (b,c) >1 then a,b,c will be in same subsequence even if gcd(a,c) = 1.

 

 

Input

 

  • The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
  • The first line of each test case contains a single integer N denoting the number of elements in the set.
  • The second line contains N space-separated integers A1, A2, ..., AN elements in the set.

 

 

Output

 

  • For each test case output a single number, the answer to given problem modulo 1000000007, in a separate line.

 

 

Constraints

 

  • 1 = T = 100
  • 1 = N = 200
  • 1 = Ai = 109

 

 

Example

Input: 2 4 2 4 3 9 3 2 3 6 Output: 36 6

Answers

(5)
Status NEW Posted 17 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)