(* Given a positive (even) integer,this program calculates all the integer side lengths of right rectangular prisms that have the same surface area. For example a surface area of 54 square units is enjoyed by rectangular prisms of dimensions 1x1x13, 1x3x6, and 3x3x3. This program is more enjoyable if one first tries to figure out, on a chalkboard for instance, the triples that give the same surface areas as cubes, like the 3x3x3 cube, as a challenge. Programmer: Robert Simms of Salisbury, MD Date: about 1993 Language: (VAX)Pascal *) program sfc(input, output); var s, s2: integer; x, y: integer; z: integer; begin write('Enter a surface area: '); while not (eoln or eof) do begin readln(s); s2 := s div 2; if (s mod 2) = 1 then writeln('Surface area must be even --> ',(s2*2):0); for x := 2-(s2 mod 2) to trunc(sqrt(s2/3)) do for y := x to trunc(-x+sqrt(x**2+s2)) do if ((s2 -x*y) mod (x+y)) = 0 then writeln(x, y, (s2-x*y) div (x+y)); write('Enter a surface area: ') end end.