1's & 2's

0

0 votes
Problem

NITH has started charging all the vehicles entering the campus. Every 4-wheeler that enters chooses OPTION 1 and pays Rs.2 and every 2-wheeler that enters chooses OPTION 2 and pays Re.1. Incidentally, everyday exactly 100 vehicles enter NITH. The security personnel at Gate 1 have a tough time calculating the sum as they get confused in between 1 and 2. Help them. You will be given a series of 1's and 2's which will be the respective option chosen by the vehicle that enters. You have to calculate the collection of NITH at the end of the day.

INPUT: First line of input will contain a number 'T' denoting the number of test cases. The next 'T' lines will contain a series of 100 1's and 2's in any order.

OUTPUT: For every test case you will have to output in a single line, the day's entire collection.

Sample Input
3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
Sample Output
200
100
150
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

TEST CASE 1: Contains 100 1's, which means all the 100 vehicles entering NITH are 4-wheelers and pay Rs.2. Hence, 1002=200. TEST CASE 2: Contains 100 2's, which means all the 100 vehicles entering NITH are 2-wheelers and pay Rs.1. Hence, 1001=100.

Editor Image

?