Var a,b,c,d,min,max: integer; begin readln(a,b,c,d); min:=a; max:=a; if (b >= max) then max:=b; if (b <= min) then min:=b; if (c >= max) then max:=c; if (c <= min) then min:=c; if (d >= max) then max:=d; if (d <= min) then min:=d; writeln((max+min)*(max+min)); end.
Var a,b,c,d,min,min1,max,max1:integer; begin Readln(a,b,c,d); if a>b then begin max1:=a; min1:=b end else begin max1:=b; min1:=a end; if c>d then begin max:=c; min:=d end else begin max:=d; min:=c end; if max1>max then max:=max1; if min1<min then min:=min1; Writeln('max=',max,' min=',min) end.
begin
readln(a,b,c,d);
min:=a;
max:=a;
if (b >= max) then max:=b;
if (b <= min) then min:=b;
if (c >= max) then max:=c;
if (c <= min) then min:=c;
if (d >= max) then max:=d;
if (d <= min) then min:=d;
writeln((max+min)*(max+min));
end.
a,b,c,d,min,min1,max,max1:integer;
begin
Readln(a,b,c,d);
if a>b then begin max1:=a; min1:=b end
else begin max1:=b; min1:=a end;
if c>d then begin max:=c; min:=d end
else begin max:=d; min:=c end;
if max1>max then max:=max1;
if min1<min then min:=min1;
Writeln('max=',max,' min=',min)
end.