Evil Forest_2018_3_18

森林之王熊热爱绘画,其杰作《回到过去》闻名遐迩。为了发掘更多绘画人才,熊王计划举办一系列绘画比赛,并指派老虎大臣协助筹备。老虎拥有一个文具厂,希望所有参赛者都能使用自家工厂生产的素描本。根据每场比赛的参赛人数,老虎需要确保有足够的素描本供应,同时还要额外准备至少10%作为备用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The Bear, king of the forest, loves painting very much. His masterpiece – “Back in time” is very famous around all over the forest. Recently he wants to hold a series painting competition to select those animals who are good at painting as well. So the Bear appoints his minister Tiger to help him prepare the painting competitions.
Tiger owns a stationery factory which produces sketchpad, so he wants to let all the competitions use the sketchpads produced by his factory privately. The Bear plans to hold N
painting competitions, and informs Tiger of the number of competitors who are ready for each competition. One competitor needs only one sktechpad in one competition. For each competition, at least 10% extra sketchpads are required as backup just in case.
The Tiger assigns you, his loyal subordinate to calculate the minimum number of sketchpads produced
by his factory.
Input The first line of the input gives the number of test cases, T. T test cases follow.
For each test case, the first line contains an integer N, where N is the number of competitions. The next line contains N integers a1,a2,...,aN representing the number of competitors in each competition.
1T100
1N1000
1ai100
Output For each test case, output one line containing “Case #x: y”, where x is the test case number (starting from 1) and y is the minimum number of sketchpads that should be produced by Tiger’s factory. Sample Input
1
6
13 11 11 11 13 11
Sample Output
Case #1: 82

        
  
Hint
For the first test case, two more sketchpads should be prepared for each painting competition.

        
 
#include<bits/stdc++.h>
using namespace std;
int main(){
	int T;
	scanf("%d",&T);
	for(int z=1;z<=T;z++){
		int n;
		scanf("%d",&n);
		int s=0;
		int a;
		while(n--){
			scanf("%d",&a);
			s+=a+(a+9)/10;
		}
		printf("Case #%d: %d\n",z,s);
	}
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值