The sharp upper bound of the lifespan of solutions to critical semilinear wave equations in high dimensions