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, 2 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 9.00

special deck of cards

Malcolm is having a special deck of cards with him. Each card has some value that are just powers of two.Each value may occur any number of times.His friend gives him a challenge to find the number of non-negative integers that can be formed as a sum of some values from the deck of cards.
Help Macolm with this challenge.

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 cards. The second line contains N space-separated integers denoting the values present on each card.

Output

  • For each test case, output a single line containing required answer.

Constraints

  • 1 = T = 100
  • 1 = N = 50
  • Each card will contain powers of two between 1 and 2^50 inclusive.

Example

Input: 2 2 1 2 4 1 1 1 1 Output: 4 5

Explanation

Example case 1.One can make 0 (without using any cards), 1 (using 1) ,2 (using 2),3 (using 1 and 2) as sums . so the answer is 4.

Answers

(5)
Status NEW Posted 17 Sep 2017 12:09 PM My Price 9.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)