思考题 with anime

Unlimited Fafnir

After watching the famous anime Unlimited Fafnir, XGN got excited. So he decided to recreate the scene of fighting the Basilisk.

This time, Yuu is going to do it himself. Let's suppose the world is a 2D plane. Then the Basilisk's heart is at location and Yuu's weapon's attack range is .

The Basilisk has 2 defense ways.

  1. He can use his third eye to shoot laser at with an attack range of and the power of it is

  2. He can use his normal eye to shoot laser at with an attack range of and the power of it is

We call someone at can be hit by a weapon at with attack range iff

If Yuu is hit by one of the defenses Basilisk makes, he will lose some health, the amount of the health equals to the power.

Now Yuu wonders, what's the minimum amount of health to lose while he can hit Basilisk's heart.

Example

a,b,c,d,e,f,g,h,i,j,k=8,4,4,14,0,10,2,6,6,6,1

Answer=1

image.png

Constriants