#!/usr/bin/env python
#
# Calculates PERT based on the optimistic, likely and worst case estimates
#
# Copyright (C) 2018 Todd Hainsworth
#
# $ ./pert 15 20 28
# 20.5

import sys


def pert(optimistic, likely, worst):
    pert = (optimistic + (4 * likely) + worst) / 6.0
    print(pert)


if __name__ == '__main__':
    args = sys.argv

    if len(args) < 4:
        print("Must provide an optimistic, likely and worst case value")
        exit(1)

    optimistic = float(args[1])
    likely = float(args[2])
    worst = float(args[3])

    pert(optimistic, likely, worst)
