{-# LANGUAGE OverloadedStrings #-} import qualified Data.ByteString.Char8 as C import Data.Char import Text.Printf solve :: Int -> Int -> Double solve a b | a == b = sqrt $ x ** 2 + y ** 2 | otherwise = sqrt $ x ** 2 - y ** 2 where a2 = realToFrac a b2 = realToFrac b x = max a2 b2 y = min a2 b2 main :: IO () main = do ss <- C.getLine let (a, ss2) = nextInt ss let (b, ss3) = nextInt ss2 printf "%.20f\n" $ solve a b nextInt :: C.ByteString -> (Int, C.ByteString) nextInt ss | isDigit x || x == '-' = nextInt2 0 ss | otherwise = nextInt $ C.tail ss where x = C.head ss nextInt2 :: Int -> C.ByteString -> (Int, C.ByteString) nextInt2 n ss | C.null ss = (n, ss) | y == '-' = (-z,zs) | isDigit y = nextInt2 (n * 10 + (digitToInt y)) ys | otherwise = (n, ys) where y = C.head ss ys = C.tail ss (z,zs) = nextInt2 0 ys