uses crt;
  const n=3;
  type mas=array[1..n] of integer;
var a,b,c:mas;
z,p,r,s:integer;

function min(var x:mas;n:integer):integer;
 var k,i:integer;

begin
k:=x[1];
for i:=2 to n do
  if k>x[i] then k:=x[i];
min:=k;
end;

function scal(var x,y:mas;n:integer):integer;
var k,i:integer;
begin
k:=0;
for i:=1 to n do
k:=x[i]*y[i]+k;
scal:=k;
end;

procedure vvod(var x:mas;n:integer);
var i:integer;
begin
for i:=1 to n do read(x[i]);
end;

begin
z:=0;
clrscr;
writeln('quantiy of vector elements=',n);
writeln('enter x');
vvod(a,n);
writeln;
writeln('enter y');
vvod(b,n);
writeln;
writeln('enter z');
vvod(c,n);
writeln;
p:=min(a,n);
r:=min(b,n);
s:=min(c,n);
 if (p>r) and (p>s) then
   z:=(scal(a,a,n)-scal(b,c,n));
if (r>p) and (r>s) then
   z:=(scal(b,b,n)-scal(a,c,n));
 if (s>r) and (s>p) then
   z:=(scal(c,c,n)-scal(a,b,n));
writeln(z);
readkey;
end.