Find the minimum area of a triangle whose sides and altitudes are six different integers.
# mta.pl
use warnings;
use strict;
{
my $a;
my $b;
my $c;
my $ha;
my $hb;
my $hc;
my $s;
for ($c=3;$c<200;$c++) {
for ($b=$c-1;$b>1;$b--) {
for ($a=$b-1;$a>$c-$b;$a--) {
$s = ($a+$b+$c)/2;
$hc = 2*sqrt($s*($s-$a)*($s-$b)*($s-$c))/$c;
if (int($hc)==$hc) {
$hb = $c*$hc/$b;
if (int($hb)==$hb) {
$ha = $c*$hc/$a;
if (int($ha)==$ha) {
if ($c*$c!=$a*$a+$b*$b) {
if ($ha!=$a) {
print "c = ",$c,",b = ",$b,",a = ",$a,"\n";
print "hc = ",$hc,",hb = ",$hb,",ha = ",$ha,"\n";
}
}
}
}
}
}
}
}
}
|
Posted by Bractals
on 2008-07-30 19:20:49 |