Optimal solvability for a nonlocal problem at critical growth