February 22, 2017

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.
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.

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 3 4
1 1 1

Sample output
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:

Related Questions

More Related Questions