using System; using System.Collections.Generic; using System.Linq; //YukiCoder419 直角三角形 //http://yukicoder.me/problems/no/419 class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("4 5"); //3.0000000000 } else if (InputPattern == "Input2") { WillReturn.Add("5 3"); //4.0000000000 } else if (InputPattern == "Input3") { WillReturn.Add("3 4"); //2.6457513111 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); double[] wkArr = InputList[0].Split(' ').Select(X => double.Parse(X)).ToArray(); double A = wkArr.Max(); double B = wkArr.Min(); double C; if (A > B) { //斜辺がAの場合 C = Math.Sqrt(A * A - B * B); } else { //斜辺がCの場合 C = Math.Sqrt(A * A + B * B); } Console.WriteLine(C); } }