As an ACMer, GSS is addicted to AC Automaton, i.e. how to AC automatically. GSS believes
that he will implement it in the future, so he works hard on it. However, it’s almost impossible for
machines to understand the problem descriptions with the stateofart natural language processing
technology.
As we all know, nothing can stop GSS. To achieve this great goal and rescue every ACMer, GSS
spares no effort to solve it. One day, an idea occurs to him. What about the entropy? According to
Ludwig Eduard Boltzmann, the entropy can be understood in terms of molecular disorder’ within
a system. Thus, GSS decides to do some research on the entropy of the input files of some ACM
problems. He believes that he can find the law from the input files, then connect it to the output.
After the day he finishes it, every ACMer will be retired.
To find the law from the input files, GSS has already done lots of experiments on these input
files. The modular arithmetic can reach the best performance, so he defines that the entropy of
connecting two numbers a, b is min(a mod b,b mod a).
Generally, the output will be related to every number in the input file. It’s quite easy for GSS to
solve. Why not connect every number with the minimum total entropy? Perfect solution. Please
tell GSS what is the minimum total entropy of connecting all the numbers of an input file.