def filter_high_fever(pat_in, pat_out, th):
    with open(pat_in, 'r') as fin, open(pat_out, 'w') as fout:
        # header = fin.readline()
        # i = header.find(',')
        # fout.write('NAME,AVG'+header[i:])
        n = nf = 0
        for lin in fin:
            ll = lin.strip().split(',')
            lt = []
            for t in ll[1:]:
                lt.append(float(t))
            avg = sum(lt)/len(lt)
            if avg > th:
                ll.insert(1, str(round(avg, 2)))
                fout.write(','.join(ll) + '\n')
                nf += 1
            n += 1
    return n, nf
