using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Seitenlänge a:");
            double a = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Seitenlänge b:");
            double b = Convert.ToDouble(Console.ReadLine());
            double x1 = -(-(1.0 / 3) * a - (1.0 / 3) * b) / 2 + Math.Sqrt(Math.Pow(((-(1.0 / 3) * a - (1.0 / 3) * b) / 2), 2) - ((1.0 / 12) * a * b));
            double x2 = -(-(1.0 / 3) * a - (1.0 / 3) * b) / 2 - Math.Sqrt(Math.Pow(((-(1.0 / 3) * a - (1.0 / 3) * b) / 2), 2) - ((1.0 / 12) * a * b));
            
            double pruef_x1 = 24 * x1 - 4 * a - 4 * b;
            double pruef_x2 = 24 * x2 - 4 * a - 4 * b;

            if (pruef_x1 < 0)
            {
                Console.WriteLine("Die Schnittlänge 'x' beträgt " + x1 + "cm!");
            }
            else 
            {
                if (pruef_x2 < 0) 
                {
                    Console.WriteLine("Die Schnittlänge 'x' beträgt " + x2 + "cm");
                }
            }

            Console.ReadKey();
        }
    }
}