2015-16 Woburn Challenge Finals - Senior Division
The Center for Exploration of Monkey Cryptography (CEMC) is an organization dedicated to wartime cryptography research amongst the primate community. As the monkeys are once again at war with the cows, this institution has become indispensable to their success in combat. After all, taking over Scarberia in the 21st century will require some of the most sophisticated code-breaking techniques in existence to infiltrate the enemies' communications. As it turns out, the cows possess a slight technological edge over the monkeys, due to their experimentation with Cow-Bots in 2002. They were therefore able to reverse engineer the structure of the CEMC's servers!
The cows have learned that the server is a network consisting of
Typical brute force attacks rely on trying every possibility to gain
access. In this case, a private key is easier to guess if it comes
"earlier" in an exhaustive list of possible guesses. So for two
different computers
Having discovered the weak cryptographic scheme of the CEMC's servers, the cows now wish to assert their dominance and generate chaos amongst the monkeys by performing a distributed denial-of-service (DDOS) attack on the network to take it down. However, they will need a weakpoint from which to initiate the attack. In particular, a weakpoint is a computer whose public key is weaker than that of every other computer that it is directly connected to. Please help the cows write a program to find a weakpoint and crash the CEMC's servers. If there are multiple such weakpoints, then any one of them will suffice.
In test cases worth
Input Specification
The first line of input consists of a single integer
Output Specification
Output a single integer between
Sample Input
4
840350
341796875
1584
735166567
Sample Output
1
Explanation
Computer
Computer
Computer
Computer
Therefore, both computers
Comments