1. 程式人生 > >【模擬】HDOJ Clarke and chemistry 5625

【模擬】HDOJ Clarke and chemistry 5625

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,bN.