Solved another one
Solved both cases for n >= 3