Under construction

Still being built. Things may change

Last One Standing

Interview

Time limit2sMemory limit1024 MB

Summary
Two units fire missiles at fixed reload intervals with a 0.5 second delay; find which player's unit is destroyed first, or whether both fall at the same moment.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

In a computer game, each unit is described by its health hh, damage dd, and time to reload tt.

When a unit fires a missile at an opposing unit, the opponent's health decreases by dd 0.5 seconds after the missile is fired. The time between consecutive missile launches by the same unit must be at least tt seconds.

For simplicity, the missile supply is infinite for all units in the game.

Two players fight in this game. The first player controls a unit with health h1h_1, damage d1d_1, and reload time t1t_1. The second player controls a unit with health h2h_2, damage d2d_2, and reload time t2t_2. Both units are fully reloaded at the start of the fight, so they can fire missiles immediately.

A unit is destroyed when its health becomes zero or negative. A player wins if there is a moment when the opponent's unit is destroyed while their own unit is not.

A missile takes 0.5 seconds to reach its target. Both units can fire at the same time and destroy each other.

Determine who wins when both players act optimally.

Input

One line contains the integers h1h_1, d1d_1, and t1t_1 (1≤h1,d1,t1≤10001 \le h_1, d_1, t_1 \le 1000).

The second line contains the integers h2h_2, d2d_2, and t2t_2 (1≤h2,d2,t2≤10001 \le h_2, d_2, t_2 \le 1000).

Output

Print player one if the first player wins, player two if the second player wins, or draw if neither player wins.

Examples3

  1. Example 1

    Input
    30 10 10
    30 15 19
    
    Expected output
    player two
  2. Example 2

    Input
    30 15 19
    30 10 10
    
    Expected output
    player one
    
  3. Example 3

    Input
    100 20 10
    100 12 5
    
    Expected output
    draw