Trying to solve this problem ASSIGN, I get the idea how to come to a solution but couldn’t approach a way to find recurrence relation and code it up, waiting for help.

1 Like

This question has already been discussed in this session. Please before posting your any question try to search it on google, quora, stackoverflow and of-course at codechef. Here is link