using System; class Laba3 { static double CalcTriangleSquareByPoints(int x1, int y1, int x2, int y2, int x3, int y3) { return Math.Abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0; } static void CalcMinOfSquares(int a, int b) { double minArea = double.MaxValue; int bestx = 0; int besty = 0; for (int x = 0; x <= a; x++) { for (int y = 0; y <= b; y++) { double area = CalcTriangleSquareByPoints(0, 0, a, b, x, y); if (area > 0 && area < minArea) { minArea = area; bestx = x; besty = y; } } } Console.WriteLine($"C = ({bestx}, {besty}), площа = {minArea}"); } static void Main(string[] args) { Console.Write("Введіть a: "); int a = int.Parse(Console.ReadLine()); Console.Write("Введіть b: "); int b = int.Parse(Console.ReadLine()); CalcMinOfSquares(a, b); } }