The 2018 ACM-ICPC Chinese Collegiate Programming Contest
Duha decided to have a trip to Singapore by plane.
The airplane had nn seats numbered from 11 to nn, and nn passengers including Duha which were also counted from 11 to nn.The passenger with number ii held the ticket corresponding to the seat with number ii, and Duha was the number 11 passenger.
All passengers got on the plane in the order of their numbers from 11 to nn.However, before they got on the plane Duha lost his ticket (and Duha was the only passenger who lost the ticket), so he could not take his seat correctly.He decided to take a seat randomly.And after that, while a passenger got on the plane and found that his/her seat has been occupied, he/she selected an empty seat randomly as well.A passenger except Duha selected the seat displayed in his/her ticket if it had not been occupied by someone else.
The first problem you are asked to calculate in this problem is the probability of t