===== PascalABC.NET ======
begin
var (k, m) := ReadInteger2;
var f: integer;
if k > m div 2 then
f := k * m - 4
else if (k <= m div 2) and (k > 0) then
f := k - 4 * m
else
f := m - 4;
Print(f)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
===== PascalABC.NET ======
begin
var (k, m) := ReadInteger2;
var f: integer;
if k > m div 2 then
f := k * m - 4
else if (k <= m div 2) and (k > 0) then
f := k - 4 * m
else
f := m - 4;
Print(f)
end.