Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program o;
- {$APPTYPE CONSOLE}
- var a1,a2,a3,b1,b2,b3,m,k:integer;
- a,b:array [1..3] of integer;
- begin
- assign(input,'input.txt');
- reset(input);
- assign(output,'output.txt');
- rewrite(output);
- read(a1,a2,a3,b1,b2,b3);
- a[1]:=a1;
- a[2]:=a2;
- a[3]:=a3;
- b[1]:=b1;
- b[2]:=b2;
- b[3]:=b3;
- m:=1;
- if a[2] > a[m] then m:=2;
- if a[3] > a[m] then m:=3;
- k:=a[1];
- a[1]:=a[m];
- a[m]:=k;
- if a[3] > a[2] then
- begin
- k:=a[2];
- a[2]:=a[3];
- a[3]:=k;
- end;
- m:=1;
- if b[2] > b[m] then m:=2;
- if b[3] > b[m] then m:=3;
- k:=b[1];
- b[1]:=b[m];
- b[m]:=k;
- if b[3] > b[2] then
- begin
- k:=b[2];
- b[2]:=b[3];
- b[3]:=k;
- end;
- write((a[1]*b[1])+(a[2]*b[2])+(a[3]*b[3]));
- close(output);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement