using System; public class Program { static double CalcMinOfSquares(int bx, int by) { double min_square = double.MaxValue; int min_x = 0; int min_y = 0; for (int cx = 0; cx <= bx; cx++) { for (int cy = 0; cy <= by; cy++) { double tsquare = CalcTriangleSquareByPoints(0, 0, bx, by, cx, cy); if (tsquare > 0 && tsquare < min_square) { min_square = tsquare; min_x = cx; min_y = cy; } } } Console.WriteLine($"Координати C: ({min_x}; {min_y})"); return min_square; } static double CalcTriangleSquareByPoints(int ax, int ay, int bx, int by, int cx, int cy) { return 0.5 * Math.Abs(ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)); } static void Main(string[] args) { Console.WriteLine("Введіть значення x: "); int bx = int.Parse(Console.ReadLine()); Console.WriteLine("Введіть значення y: "); int by = int.Parse(Console.ReadLine()); if (bx <= 0 || by <= 0) { Console.WriteLine("Потрібно ввести додатні числа"); return; } double tsquare = CalcMinOfSquares(bx, by); Console.WriteLine($"Мінімальна площа трикутника: {tsquare}"); } }