|
||||||||||
LifeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 775 Accepted Submission(s): 480 Problem Description Samuel,Former Zua leader,was arrested and had to stay in prison during the Spring Festival. He was in custody for money laundering and other cases. According to the report,Samuelwas alleged to have embezzled 104 million New Zua dollars ($3.15 million) in public funds, accepted bribes of about $9 million in a land purchase deal, and taken a kickback of $2.7 million from a construction project. Although Samuel is a smart lawyer,he was still arrested due to his illegal actions. Now Samuel has a question for you:If you are given the legislations of Zua,can you tell how many years he stay in the prison? The legislations of Zua are supposed as the following few lines: Input Input will contains 3 parts. There is an integer t in the first line meaning t test cases. Then the next line has 2 parts:n(represents the cases Samuel was accused with),s(a string with the length of n,only contains ¡°0¡±,¡±1¡±.Here ¡®0¡¯means he was not accused with this case,and ¡®1¡¯means he was accused with this case ) .The next n lines have the numbers of New Zua dollars(the unit is million) he was accused with. Output According to the law,please output how many years Samuel will stay in the prison. Use the format¡±Samuel was accused with m case(s),and he will stay in the prison for c year(s).¡±Here m means the case number,c means the years he have to stay. Sample Input
Sample Output
Author Samuel Source | ||||||||||
|