print("Enter the fi and interval")
ci1l=int(input("Enter the lower class of first interval = "))
ci1u=int(input("Enter the upper class of first interval = "))
fi1=int(input("Enter the first fi = "))
fi2=int(input("Enter the second fi = "))
fi3=int(input("Enter the third fi = "))
fi4=int(input("Enter the fourth fi = "))
fi5=int(input("Enter the fifth fi = "))
cs=(ci1u-ci1l)
ci2l=ci1u
ci2u=(ci2l+cs)
ci3l=ci2u
ci3u=(ci3l+cs)
ci4l=ci3u
ci4u=(ci4l+cs)
ci5l=ci4u
ci5u=(ci5l+cs)
cm1=(ci1u-ci1l)/2+ci1l
cm2=(ci2u-ci2l)/2+ci2l
cm3=(ci3u-ci3l)/2+ci3l
cm4=(ci4u-ci4l)/2+ci4l
cm5=(ci5u-ci5l)/2+ci5l
m=((fi1*cm1)+(fi2*cm2)+(fi3*cm3)+(fi4*cm4)+(fi5*cm5))/(fi1+fi2+fi3+fi4+fi5)
print("____________________________")
print("| CI | fi | xi |")
print("|",ci1l,"-",ci1u," |"," ",fi1," |",cm1,"|")
print("|",ci2l,"-",ci2u," |"," ",fi2," |",cm2,"|")
print("|",ci3l,"-",ci3u," |"," ",fi3," |",cm3,"|")
print("|",ci4l,"-",ci4u," |"," ",fi4," |",cm4,"|")
print("|",ci5l,"-",ci5u," |"," ",fi5," |",cm5,"|")
print("----------------------------")
print("Therefore, the mean is = ",m)