#!/usr/local/bin/perl -w --

if($ARGV[0] =~ m/^-copy/)	{
	my $copy = $ARGV[1];
	print STDERR "#copy $copy\n";
	print "#copy $copy\n";
	shift(@ARGV);
	shift(@ARGV);
	}

$e = 0;
for($i=0;$i<=$#ARGV;$i++)	{
	print STDERR "'$ARGV[$i]'" . " ";
	if($i == 0)	{
		$e += ($ARGV[0]+$ARGV[1])*($ARGV[0]+$ARGV[1])*100;
		}
	else	{
		$e += $ARGV[$i]*$ARGV[$i] * ($i-2.01)*($i-2.01);
		}
	}
print STDERR  "->" .  $e . "\n";
print  $e . "\n";
