import scala.math.sqrt

object StddevCalc extends App {

  def calcAvgAndStddev[T](ts: Iterable[T])(implicit num: Fractional[T]): (T, Double) = {
    def avg(ts: Iterable[T])(implicit num: Fractional[T]): T =
      num.div(ts.sum, num.fromInt(ts.size))