Can anyone give me a solution for this?
the program should output how can the chemical equation be balanced (which are the coefficients)
28th ACM International Collegiate Programming Contest, 2003-2004 Asia Region, Tehran Site
Balanced Chemical Equations
Sample Input
3
HCl+CaO2H2=CaCl2+H2O
HCl+H2SO4=NaCl
HCl+NaOH=NaCl+H2O
Sample Output
2 1 1 2
IMPOSSIBLE
1 1 1 1
dejandenib -8 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.