CF200B.Drinks
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Little Vasya loves orange juice very much. That's why any food and drink in his kitchen necessarily contains orange juice. There are n drinks in his fridge, the volume fraction of orange juice in the i-th drink equals p__i percent.
One day Vasya decided to make himself an orange cocktail. He took equal proportions of each of the n drinks and mixed them. Then he wondered, how much orange juice the cocktail has.
Find the volume fraction of orange juice in the final drink.
小瓦西亚非常喜欢橙汁。因此,他厨房里的所有食物和饮料都必然含有橙汁。他的冰箱里有 n 种饮料,第 i 种饮料中橙汁的体积分数为 pi 百分比。
一天,瓦西亚决定为自己调制一杯橙汁鸡尾酒。他取了每种饮料等量的份,并将它们混合在一起。随后,他想知道:最终的鸡尾酒中橙汁的体积分数是多少?
请计算最终饮品中橙汁的体积分数。
输入格式
The first input line contains a single integer n (1 ≤ n ≤ 100) — the number of orange-containing drinks in Vasya's fridge. The second line contains n integers p__i (0 ≤ p__i ≤ 100) — the volume fraction of orange juice in the i-th drink, in percent. The numbers are separated by a space.
第一行输入包含一个整数 n(1≤n≤100)—— 表示瓦夏冰箱中含橙汁饮料的种数。
第二行包含 n 个整数 pi(0≤pi≤100)—— 表示第 i 种饮料中橙汁的体积分数(以百分比为单位)。这些数字以空格分隔。
输出格式
Print the volume fraction in percent of orange juice in Vasya's cocktail. The answer will be considered correct if the absolute or relative error does not exceed 10 - 4.
输出瓦夏鸡尾酒中橙汁的体积百分比。若绝对误差或相对误差不超过 10−4,则答案视为正确。
输入输出样例
输入#1
3 50 50 100
输出#1
66.666666666667
输入#2
4 0 25 50 75
输出#2
37.500000000000
说明/提示
Note to the first sample: let's assume that Vasya takes x milliliters of each drink from the fridge. Then the volume of pure juice in the cocktail will equal
milliliters. The total cocktail's volume equals 3·x milliliters, so the volume fraction of the juice in the cocktail equals
, that is, 66.(6) percent.
第一个样例的说明:假设瓦西娅从冰箱中每种饮料各取 x 毫升。则鸡尾酒中纯果汁的体积为
毫升。鸡尾酒总体积为 3·x 毫升,因此果汁在鸡尾酒中的体积分数为
,即 66.(6) 百分比。
输入解题思路,AI测评打分。不知道怎么写?