#P1033. [NOIP 2002 提高组] 自由落体

[NOIP 2002 提高组] 自由落体

Description

On a ceiling of height HH, there are nn balls with negligible size, located at positions 0,1,2,,n10, 1, 2, \cdots, n-1. On the ground there is a cart (length LL, height KK) at a distance S1S_1 from the origin. The falling distance of a ball is given by d=0.5×g×(t2)d=0.5 \times g \times (t^2), where g=10g=10 and tt is the falling time. The cart moves forward at speed VV.

As shown in the figure:

The cart and all balls start moving at the same time. When the distance between a ball and the cart is 0.0001\le 0.0001 (thanks to Silver_N for the correction), the ball is considered caught by the cart. A ball cannot be caught after it has reached the ground.

Please compute how many balls the cart can catch.

Source: NOIP 2002 Senior, Problem 3.

Input Format

A single line contains six integers H,S1,V,L,K,nH, S_1, V, L, K, n.

Constraints: 1H,S1,V,L,K,n1000001 \le H, S_1, V, L, K, n \le 100000.

Output Format

Output a single integer: the number of balls the cart can catch.

5.0 9.0 5.0 2.5 1.8 5

1

Hint

If a ball falls into the rear end of the cart, it is considered to have fallen into the cart.

Translated by ChatGPT 5