In the Pass the Buck game, there are several players and each player has one or more neighbors among the other players. Each game begins with one player chosen at random who receives a buck (the current holder). (For this game, chosen at random means each possible outcome has the same probability.) Then, at each step, if the current holder has d neighbors, he/she chooses an integer k in the range [0, d] at random. If 0 is chosen, the current holder is the winner and keeps the buck. Otherwise, the holder passes the buck to the neighbor with index k, who becomes the new holder. The game continues until some holder wins. Write a program to find the probability that player j wins if player k is the first holder.
Sample 2On February 15, 2012, the New York Times reported a flaw in the method of generating keys for a public-key encryption system. This flaw enables an attacker to determine private keys given a set of flawed public keys. Your job is to write a program that takes flawed public keys and determines the corresponding private keys.
For the purposes of this problem, a private key consists of a pair of prime numbers
2 < K1, K2 < 231
and the corresponding public key consists of the product K1 x K2
While they did not dominate the competition (Cornell ended up winning), the three teams were among the many teams that finished about one-third of the problems, testifying to their difficulty and the pressure of the situation. Onward to next year’s contest!

