var
A, B, K, R : longint;
begin
readln(A, B);
if (A mod 2 = 1) and (B mod 2 = 1) then
writeln('-1');
if (A mod 2 = 0) and (B mod 2 = 0) and
((A div 2 <> B) or (B div 2 <> A)) then
((A div 2 = B) or (B div 2 = A)) then
if A > B then
writeln(B, '0')
else
writeln('0', A);
if (A mod 2 = 1) and (B mod 2 = A) then begin
A := A-1;
B := B-2;
if (A div 2 = B) or (B div 2 = A) then
end;
if (B mod 2 = 1) and (A mod 2 = B) then begin
B := B-1;
A := A-2;
if (B div 2 = A) or (A div 2 = B) then
if B > A then
writeln('0', A)
end.
На Всё что могу.
begin
writeln('Введите строны первого треугольника: ');
read(a1, b1, c1);
writeln('Введите стороны второго треугольника: ');
read(a2, b2, c2);
p1 := (a1 + b1 + c1) / 2;
p2 := (a2 + b2 + c2) / 2;
s1 := sqrt(p1 * (p1 - a1) * (p1 - b1) * (p1 - c1));
s2 := sqrt(p2 * (p2 - a2) * (p2 - b2) * (p2 - c2));
if (s1 + 1e-3 > s2) and (s1 < s2 + 1e-3) then writeln('Равновеликие')
else writeln('Неравновеликие');
end.
var
A, B, K, R : longint;
begin
readln(A, B);
if (A mod 2 = 1) and (B mod 2 = 1) then
writeln('-1');
if (A mod 2 = 0) and (B mod 2 = 0) and
((A div 2 <> B) or (B div 2 <> A)) then
writeln('-1');
if (A mod 2 = 0) and (B mod 2 = 0) and
((A div 2 = B) or (B div 2 = A)) then
if A > B then
writeln(B, '0')
else
writeln('0', A);
if (A mod 2 = 1) and (B mod 2 = A) then begin
A := A-1;
B := B-2;
if (A div 2 = B) or (B div 2 = A) then
if A > B then
writeln(B, '0')
else
writeln('0', A);
end;
if (B mod 2 = 1) and (A mod 2 = B) then begin
B := B-1;
A := A-2;
if (B div 2 = A) or (A div 2 = B) then
if B > A then
writeln(B, '0')
else
writeln('0', A)
end;
end.
На Всё что могу.