#P1785. Chain Finish Move

    ID: 15070 Type: Default 1000ms 256MiB

Chain Finish Move

Chain Finish Move

In this problem, you are given three integers \(x\), \(y\), and \(z\) where:

  • \(x\) is the remaining HP of the Boss,
  • \(y\) is the current (and maximum) HP of absi2011's penguin, and
  • \(z\) is the maximum damage of the weapon which has a chance to chain hits.

Your task is two‐fold.

  1. First, determine if it is possible to kill (i.e. achieve an absolute finish) the Boss by a sequence (possibly a chain) of hits. If possible, output a single line Yes; otherwise output No. However, if the input data is wrong, output Wrong Data and nothing else.</p>

    The input data is considered wrong if any of the following conditions hold:

    • \(y \le 0\) or \(y > 315\)
    • \(y \ge x\)
    • \(x > 1800\) (the Boss in Tower of Fight does not have more than \(1800\) HP);
    • \(z \ge 1000\) (the weapon damage does not reach such high figures);
    • \(z \le 100\) (absi2011 does not consider \(\le 100\) damage as an absolute finish).
  2. If the answer to the first part is Yes (i.e. the kill is possible), then under the assumption that every hit deals the maximum damage \(z\), let the number of hits required be \(n=\lceil\frac{x}{z}\rceil\). Note that if a single hit kills the Boss, there is no chained lifesteal, except that the lifesteal from the killing blow is still counted.</p>

    After each hit (including the killing hit), the penguin triggers a lifesteal effect but its recovered HP cannot exceed its maximum value (which is \(y\)). There are three different lifesteal modes:

    • 3-star bloodlust: Recovers \(\lfloor 0.33 \times z \rfloor\) HP per hit.
    • 4-star bloodlust: Recovers \(\lfloor 0.50 \times z \rfloor\) HP per hit.
    • 5-star Star-Absorption: Recovers \(1.00 \times z\) HP per hit (no flooring required).

    For each mode, simulate the process: starting with current HP \(y\), after each hit add the corresponding lifesteal amount but cap the HP at \(y\) (i.e. if the sum exceeds \(y\), it is set to \(y\)). There will be \(n\) hits (if \(n=1\), only the killing hit applies). If after the sequence the penguin's HP recovers to full (i.e. equals \(y\)), then that mode is considered to "completely win".

    Output requirements for the modes are as follows (each output on a separate line, in the order given):

    • If the 3-star mode leads to full recovery, output a line with Great.
    • If the 4-star mode leads to full recovery, output two lines: first Eh.. and then OK.
    • If the 5-star mode leads to full recovery, output three lines: first Oh.., second Oh.., and third Yes , If he can get 5-star.

    If none of the three modes allow full recovery, then output three lines each with No followed by a fourth line containing the final HP after applying the 4-star lifesteal mode.

Note: In all cases, if the input data is wrong you should output only Wrong Data and nothing else.

inputFormat

The input consists of three integers \(x\), \(y\), and \(z\) on one line separated by spaces.

outputFormat

If the data is wrong, output a single line Wrong Data. Otherwise, if a chain kill is possible, first output Yes on a line. Then, depending on the lifesteal simulation for each mode, output as follows:

  • If 3-star mode recovers full HP, output a line with Great.
  • If 4-star mode recovers full HP, output two lines: Eh.. and then OK.
  • If 5-star mode recovers full HP, output three lines: Oh.., Oh.., and Yes , If he can get 5-star.
  • If none of the modes result in full recovery, output three lines each with No and a fourth line with the final HP from the 4-star simulation.

Each output should be on its own line.

sample

500 300 200
Yes

Great Eh.. OK Oh.. Oh.. Yes , If he can get 5-star.

</p>