I tried this Problem then i am able to get the dp relation dp[i][k]=(1/(i+1))*dp[i-1][k]+(i/(i+1))*dp[i-1][k-1] where dp[i][k] represent the probability of collection of k candies in first i bags . But here the value of N is very high so i am unable to solve it,that will be great help,Thanks in advance
Please even once vote up my comment ! I'd be happy.
Did you by any chance go through the TC forum to check if a solution/editorial had been posted?
Xellos there is no editorial publish for this problem ,i checked it before i asked
Try harder.
(Which leads to the same link as dreamoon_love_AA's post)
http://codeforces.me/blog/entry/13381
Thanks dreamoon_love_AA