#B4213. Frog Rendezvous

    ID: 11870 Type: Default 1000ms 256MiB

Frog Rendezvous

Frog Rendezvous

Given a pond of length LL, two frogs start swimming simultaneously from opposite banks. The first frog starts at the left bank and swims to the right with constant speed V1V_1, while the second frog starts at the right bank and swims to the left with constant speed V2V_2. Whenever a frog reaches a bank, it instantly reverses direction and continues swimming at the same speed. In a total time of TT time units, determine the number of times the two frogs meet.

Note: Let X=(V1+V2)TLX = \frac{(V_1+V_2)T}{L}. If XX is an integer and positive, then the answer is X1X-1, otherwise it is X\lfloor X \rfloor. (Meetings exactly at time TT when both frogs reach the bank are not counted as a meeting.)

inputFormat

Input consists of a single line containing four space-separated positive numbers: LL, V1V_1, V2V_2, and TT.

outputFormat

Output a single integer representing the number of times the two frogs meet within TT time units.

sample

10 1 1 10
1