第17周周赛(大一) --A - Parallelepiped

A - Parallelepiped
Crawling in process... Crawling failed Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u
Submit Status Practice CodeForces 224A

Description

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.

Sample Input

Input
1 1 1
Output
12
Input
4 6 6
Output
28
由组成一个角的三个面,计算长方形的面积。首先计算三边边长 , 边长a,b,c 三边面积x,y,z  记a*b=x ; a*c=y ; b*c = z ;
可以计算出三边
 
     
#include<stdio.h>
#include <math.h>
int main()
{
	int a, b , c , i , x , y , z , max = 0;
	scanf("%d %d %d", &a, &b, &c);
	x = sqrt(a*c/b);
	y = a / x ;
	z = b / y ;
	printf("%d\n", 4*(x+y+z));
	return 0;
}

你可能感兴趣的:(第17周周赛(大一) --A - Parallelepiped)