• [A] Ahri

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Ahri is a champion of 'League of Legends', called the 9 tails fox.

    She has ability, Fox-Fire. Ahri releases three fox-fires. After a short delay they lock on to nearby enemies (prioritizes champions).


    To simplify this problem, we remake the rule like this:

    1. Ahri release three fox-fires with no delay. That means it will hit others immediately.

    2. The attack range is a circular area. Ahri is at the center of a circle.

    3. If there're more than 3 enemy champions in the circle, the fox-fires will attack the nearest three. If their distance is the same, then the fire will priority attack the one in front of lexicographical order of their names.

    4. If there're less than 3 enemy champions in the circle, the fox-fires will attack the nearest enemy force unit in the circle.

    5. If there're less than 3 enemy champions and enemy force unit, it will reAttack by the order of these rules.

    6. Each attack of fox-fire will reduce an enemy fixed value of HP.

    7. If a champion or unit died, it will never be attacked again.

    8. If there are no more units to attack, the fox-fire will disappear.

    9. If the distance of two enemy units to Ahri is the same, attack the one input first.


  • 输入
  • This problem contains several cases, input until EOF.
    The first line of each case contains 3 floats and 1 integer R, X, Y, and D; stand for the radius of the circle, X, Y of Ahri and the damage value.
    Then follows 5 lines, each line contains an enemy champion's name (the length is less than 20 with no space), x and y coordinate (float) of it and its HP (positive integer).
    Next line contains an integer U (0 <= U <= 50) stands for the number of enemy units.
    Then follow U line(s), each line contains x, y, H, stand for the x and y coordinate of it and its HP.
  • 输出
  • For each case, you should output 5 enemy champions' names and theirs HP. Each champion one line. Order by lexicographical of their name.
  • 样例输入
  • 5.00 0.00 0.00 100
    Ashe 1.00 1.00 50
    XinZhao 2.00 2.00 120
    Cho'Gath 1.00 2.00 3000
    Ezreal 2.00 1.00 1000
    LeBlanc -1.00 -1.00 500
    1
    -1.00 -2.00 30
    
  • 样例输出
  • Ashe 0
    Cho'Gath 2900
    Ezreal 1000
    LeBlanc 400
    XinZhao 120
    
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜