/*

Our chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English name to apply for an international patent). The stripies are transparent amorphous amebiform creatures that live in flat colonies in a jelly-like nutrient medium. Most of the time the stripies are moving. When two of them collide a new stripie appears instead of them. Long observations made by our scientists enabled them to establish that the weight of the new stripie isn't equal to the sum of weights of two disappeared stripies that collided; nevertheless, they soon learned that when two stripies of weights m1 and m2 collide the weight of resulting stripie equals to 2*sqrt(m1*m2). Our chemical biologists are very anxious to know to what limits can decrease the total weight of a given colony of stripies.
You are to write a program that will help them to answer this question. You may assume that 3 or more stipies never collide together.
Input

The first line of the input contains one integer N (1 <= N <= 100) - the number of stripies in a colony. Each of next N lines contains one integer ranging from 1 to 10000 - the weight of the corresponding stripie.

Output

The output must contain one line with the minimal possible total weight of colony with the accuracy of three decimal digits after the point.

Sample Input

3
72
30
50

Sample Output

120.000

*/
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
using namespace std;
int main()
{
 int n;
 while(cin >> n)
    {
        priority_queue<double> q;
        while(n--)
        {
            int a;
            cin >> a;
            q.push(a);
        }
        double aim = q.top();
        while(q.size() > )
        {
            double x = q.top();
            q.pop();
            double y = q.top();
            q.pop();
            double ans = * sqrt(x * y);
            q.push(ans);
        }
        aim = q.top();
        //cout << q.top() << endl;
        printf("%.3lf\n",aim);
    }
 return ;
}

最新文章

  1. Spring+Quartz实现定时任务
  2. textarea 在浏览器中固定大小和禁止拖动
  3. Win10如何设置防火墙开放特定端口 windows10防火墙设置对特定端口开放的方法
  4. IOS调试lldb命令常用,po,
  5. Redis学习笔记(9)-管道/分布式
  6. TWaver HTML5 (2D)--基本概念
  7. Jsch
  8. 使ViewFlipper中的WebView实现手势效果
  9. 使用padding-top实现自适应背景图片
  10. 关于Redis的一些常识
  11. Jquery时间快捷控件(Jtime)配置v1.1
  12. 查看Android下生成的.db数据库
  13. Ubuntu上安装VMware tools
  14. .net排坑篇:负载均衡域名转发的背后
  15. js获取元素下标
  16. 【转】 js数组 Array 交集 并集 差集 去重
  17. 状态管理Vuex
  18. php 中的 “!=”和“!==”
  19. [rrdtool]监控和自己主动绘图,简单的监控.md
  20. 视锥体(frustum)裁剪

热门文章

  1. linux-centos6/7初始配置
  2. IntelliJ IDEA神器使用技巧笔记
  3. List集合的clear方法
  4. selenium ie 模拟request pahonjs
  5. openstack 基镜像与差异镜像的整合
  6. CUDA C Programming Guide 在线教程学习笔记 Part 11
  7. tp5 redis 单例模式 转载
  8. linux 下创建文本的方法
  9. XMLTransformProvider
  10. 更改linux swappiness 提高物理内存使用率