UVA10604 Chemical Reaction

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1545 [PDF](https://uva.onlinejudge.org/external/106/p10604.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10604/38739c7c5d711e3f18e7e2865af4d9114a064ee1.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10604/d9e8bf1614e0fbdbc93adaa410396213598a8b56.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10604/f24b4e18927c8fde11d2581f6b5d03d635394f86.png)