analyst votes on the film precisely once. Since you have two servers, you can really control the votes with the goal that your film gets whatever number upvotes as could reasonably be expected. At the point when a commentator enters a site, you know their sort, and you can send them either to the principal server
Correct answer will be upvoted else downvoted. Computer science.
Every analyst votes on the film precisely once.
Since you have two servers, you can really control the votes with the goal that your film gets whatever number upvotes as could reasonably be expected. At the point when a commentator enters a site, you know their sort, and you can send them either to the principal server or to the subsequent one.
What is the most extreme absolute number of upvotes you can assemble over the two servers if you choose which server to send every commentator to?
Input
The principal line contains a solitary integer t (1≤t≤104) — the number of testcases.
Then, at that point, the depictions of t testcases follow.
The principal line of each testcase contains a solitary integer n (1≤n≤50) — the number of analysts.
The second line of each testcase contains n integers r1,r2,… ,rn (1≤ri≤3) — the kinds of the commentators in a similar request they enter the site.
Output
For each testcase print a solitary integer — the greatest complete number of upvotes you can accumulate over the two servers if you choose which server to send every analyst to.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)