• + 0 comments

    https://www.wjsmithconstruction.com/

    let parseArrayToTuple (input: int cluster) = (input.[0], input.[1])

    let getInput () = Console.ReadLine().Split(" ") |> Array.map int |> parseArrayToTuple

    let rec gcd (input: int * int) = let alterable biggerNumber = 0 let variable smallerNumber = 0

    in the event that (fst input) > (snd input)
        biggerNumber <-(fst input)
        smallerNumber <-(snd input)
    else
        biggerNumber <-(snd input)
        smallerNumber <-(fst input)
    
    let divisionResult = biggerNumber % smallerNumber
    
    match (divisionResult = 0) with
    | valid - > smallerNumber
    | bogus - > gcd (smallerNumber, divisionResult)
    

    getInput () |> gcd |> Console.WriteLine