Friday
October 24, 2014

Homework Help: programming language

Posted by Ryan on Tuesday, October 27, 2009 at 2:05am.

can enyone help me figure this out...
Surface to Volume Ratio

Write a program to compute surface to volume ratio. We will be given the height, width, and depth of N cuboid, and determine the smallest surface to volume ratio among them.
Input
The first line of the input data consists of N, where 0 < N <= 1000. The next N lines contain the height, width, and depth of each cuboid. All the dimensions are between 1 and 50.

Output
You should output the smallest surface to volume ratio as "a/b". This number must be simplified, that is, a and b must be prime to each other.
Sample input
2
2 3 4
1 1 1

Sample output
13/6
Hint: You may find the following recursive definition of greatest common divisor (gcd) useful. Let a >Άκ > 0. If the reminder of dividing a by b is 0, then of course the gcd of a and b is b. If the reminder is non-zero number c, then the gcd of and b is equal to the gcd of b and c.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Biology - When cells increase in size, the surface area to volume ratio ...
bio - How does the surface area-to-volume ratio of a 1-mm cube compare to the ...
Math - A rectangular prism has a volume of 960cm. It's width, length, and ...
volume:ration - A worm has a diameter of 2.4cm and its length is upto 1.9M. a)...
Bio - Please Check my work and help me to answer the questions i could not get. ...
Bio - Please Check my work and help me to answer the questions i could not get. ...
C Programming - I am new to c programming and I cannot understand the teacher ...
science - 1. For the three cubes shown below, determine their surface area, ...
bio - 3. For the three cubes shown below, determine their surface area, volume ...
science - for the three cubes shown below, determine their surface area, volume ...

Search
Members