Maybe you should have just listened harder in class.
Learning is not about getting people to do your homework. If that doesn't annoy anyone who mignt otherwise help, the lack of line wrapping in your post will!
The specification does not actually explain what the "the solution to the problem for n<=20 robbers" is! I assume you must at least know that? Since we are not told, you cannot expect an answer.
Other than that, recursion is simple. The function must call itself with a lower order parameter, such that the problem is expressed in terms of the value passed, and the simpler function call, until the simplest value is passed in, which case (the terminal case), a specific answer is output. You must ensure that the terminal case is always met, otherwise you will get a stack overflow, which may still happen if the terminal case is not met soon enough; which is why recursion is usually avoided in real code and over-emphasiesd in computer science courses. (IMHO).
Calculate factorial (n!), eg. 3! = 3 * 2 * 1 = 6
unsigned int factorial( unsigned int val )
unsigned int ret_val ;
if( val <= 2 ) // terminal condition
// answer is 2, 1, or zero (i.e. val)
ret_val = val ;
// answer is val * (val-1)!
ret_val = val * factorial( val - 1 ) ;
return( ret_val ) ;
Often you'll see recursive solutions with multiple returns rather than the assignment to a temporary value (ret_val) as I have done. Which is another horror that CS courses are seem to encourage.