Flight of the Hamster 3#2944

Flight of the Hamster 3

ثانية
64 ميغابايت
صعب جدًا

In Hamsterburg, the annual Flying Hamster Competition takes place. This year, the rules are as follows:

A hamster is launched from a slingshot at a fixed point on the ground with an initial speed . There are several checkpoints in the air. If the hamster's flight path passes through a checkpoint, it stops at that checkpoint and can be launched again from that point at any angle, with initial speed .

All checkpoints are located in the same plane, perpendicular to the ground, and the starting point is also in this plane. In this plane, there are also several circular obstacles. The hamster's trajectory cannot pass through the interior of any circle (it may touch its boundary). Circles do not touch or cover any checkpoint or the starting point, but they may intersect with each other and partially extend underground.

The hamster must reach a specified checkpoint within a given time , possibly via other checkpoints. If the hamster succeeds, it earns points. Fewer points correspond to a better flight.

Suppose a path consists of points p_0, p_1, \ldots, p_k, where p_0 is the starting point and p_k is the target checkpoint. If the hamster arrives at p_i at angle a_i degrees and departs at angle b_i degrees, let c_i be the minimal (absolute) rotation from a_i to b_i. Then, for such a path, Q = \max\{c_i\}. What is the minimal number of points the hamster can achieve?

Ignore the sizes of the hamster and slingshot, as well as air resistance. The acceleration due to gravity is ms^2. The hamster cannot start and end a jump at the same checkpoint.

المدخلات

The first line contains integers (number of checkpoints), (number of circles), (initial speed in ms), and (time in s).

Each of the next lines contains two integers , — the coordinates (in meters) of a checkpoint. The hamster must reach the checkpoint specified last.

Each of the following lines contains three integers , , — the coordinates and radius (all in meters) of a circle.

The starting point has coordinates .

Constraints

1 \leq n \leq 100

0 \leq m \leq 100

1 \leq V \leq 100

1 \leq T \leq 100

-100 \leq x \leq 100

0 \leq y \leq 100

1 \leq r \leq 100

المخرجات

Output the minimal number of points the hamster can achieve, to three decimal places, or -1 if the hamster cannot reach the final checkpoint within seconds.

أمثلة

مثال 1

Loading
Loading