Recipe Reconstruction -- Wrong Answer -- Please Help !!

I am getting wrong answer . The code is at http://www.codechef.com/viewsolution/4479206.

Kindly help me find the mistake.

Thank you :slight_smile:

Minor mistake.

http://www.codechef.com/viewsolution/4479806

Hereโ€™s the link to your AC solution. Note that problem statement says that you have to output final answer modulo 10000009.

:slight_smile:

//