Optimal Design of Pension Rule with Flexible Retirement: The Two-Type Case · Study