I saw this question on Hackerearth in a recent college contest .Link is here.(Editorial is not available).Can someone please help me here. I think this is related to linearity of expectation values ,But How do we model this problem in that way??? Please share your approach to this problem :) Thanks in advance ...