【模擬】HDOJ Clarke and chemistry 5625
阿新 • • 發佈:2019-01-24
Clarke is a patient with multiple personality disorder. One day, Clarke turned into a junior student and took a chemistry exam.
But he did not get full score in this exam. He checked his test paper and found a naive mistake, he was wrong with a simple chemical equation balancer.
He was unhappy and wanted to make a program to solve problems like this.
This chemical equation balancer follow the rules:
Two valences A combined by | A| elements
and B combined
by |B| elements.
We get a new valence C by a combination reaction and the stoichiometric coefficient of C is 1. Please calculate the stoichiometric coefficient a of A and b of Bthat aA+bB=C,a,b∈N∗.
But he did not get full score in this exam. He checked his test paper and found a naive mistake, he was wrong with a simple chemical equation balancer.
He was unhappy and wanted to make a program to solve problems like this.
This chemical equation balancer follow the rules:
Two valences A combined by |
We get a new valence C by a combination reaction and the stoichiometric coefficient of C is 1. Please calculate the stoichiometric coefficient a of A and b of Bthat aA+bB=C,a,b∈N∗.