problem 23 is finally over, in C to make it even harder