当前位置: 首页 > news >正文

练习224A. Parallelepiped

题目如下
A. Parallelepiped
time limit per test2 seconds
memory limit per test256 megabytes
You've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that have a common vertex. Your task is to find the sum of lengths of all 12 edges of this parallelepiped.

Input
The first and the single line contains three space-separated integers — the areas of the parallelepiped's faces. The area's values are positive ( > 0) and do not exceed 104. It is guaranteed that there exists at least one parallelepiped that satisfies the problem statement.

Output
Print a single number — the sum of all edges of the parallelepiped.
题目大意
一个数学题,给顶一个长方体的三个相邻的共顶点的面的面积,求这个长方体的三边长并输出总的边长和。

题目分析
三面面积之积就等于三边长积的平方。

点击查看代码
#include <iostream>
#include <cmath>
using namespace std;int main() {int ab, bc, ac;cin >> ab >> bc >> ac;int a = sqrt( ab * ac / bc);int b = sqrt( ab * bc / ac);int c = sqrt( bc * ac / ab);int ans = 4 * (a + b + c);cout << ans << endl;return 0;
}
http://www.njgz.com.cn/news/124.html

相关文章:

  • 动态规划从精通到入门
  • 树形DP-Part 1
  • TRVCOST - Travelling cost 题解
  • 第一天
  • 111
  • 10
  • 7.26 4
  • DAY22
  • 30天总结-第二十六天
  • 周末
  • foobar2000 v2.24.6 汉化版
  • 今天做什么
  • 20天
  • OI集训 Day10
  • 【leetcode刷题】动态规划 Part4 经典线性DP
  • linux快照工具 timeshift
  • 关于LCD屏幕硬件参数
  • 今日总结
  • 莫队二次离线 学习笔记
  • 运算符
  • 进度
  • 软工7.26
  • DMY集训记录
  • Idea 构建 jar包
  • 2025 暑期模拟赛题目选记
  • 7月26日随笔
  • Learn Learn IdaPython
  • 启发式算法解析:经典思想、代表人物与前沿融合
  • day25