编程介的小学生 2017-12-01 17:13 采纳率: 20.5%
浏览 840
已采纳

Life

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.15million)inpublicfunds,acceptedbribesofabout9 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
2
3
011
10 5 15
5
01101
1 10 10 100 31

Sample Output
Samuel was accused with 2 case(s),and he will stay in the prison for 5 year(s).
Samuel was accused with 3 case(s),and he will stay in the prison for 20 year(s).

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-12-02 15:56
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题