Can anyone help ? I can't understand this recursion function
https://codeforces.com/contest/96/problem/B
Solution : https://ideone.com/c08AT5