#P1994. 有机物燃烧

有机物燃烧

Description

Given an organic compound containing only C, H, O \text{C, H, O} elements, output the coefficients of CO2 \mathrm{CO_2} and H2O \mathrm{H_2O} in the balanced chemical equation for its reaction with oxygen.

Input Format

One line, a string representing the organic compound.

Output Format

Two numbers, which are the coefficients of CO2 \mathrm{CO_2} and H2O \mathrm{H_2O} , respectively.

C2H5OH
2 3

Hint

Sample explanation:

$$\mathrm{C_2H_5OH + 3 O_2 \xlongequal{\text{点燃}} 2 CO_2 + 3 H_2O}$$

For 100%100\% of the testdata:

  • The string length does not exceed 1010.
  • The coefficients of CO2 \mathrm{CO_2} and H2O \mathrm{H_2O} to be found do not exceed 400400.
  • The given organic compound is valid and contains only C, H, O \text{C, H, O} elements.

Translated by ChatGPT 5