• + 0 comments

    in R Could be:

    stdin <- file('stdin')
    open(stdin)
    
    stats <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]])
    less <- as.numeric(trimws(readLines(stdin, n = 1, warn = FALSE), which = "both"))
    between <- as.numeric(strsplit(trimws(readLines(stdin, n = 1, warn = FALSE), which = "right"), " ")[[1]])
    mean <- stats[1]
    sd <- stats[2]
    cat(round(1 - pnorm(less, mean, sd, FALSE),3), fill=TRUE)
    cat(round(pnorm(between[2], mean, sd, TRUE) - pnorm(between[1], mean, sd, TRUE),3), fill=TRUE)