-->
当前位置:首页 > 题库

PROGRAMMING:Zxf's pursuit

Luz5年前 (2021-05-10)题库471
$$zxf $$especially likes to go to the golden arch. He often asks $$DH $$to go to the golden arch with him. However, $$DH $$has a habit after eating every time, that is, $$zxf $$who is so angry that he starts to catch up with $$DH $$.
It is known that $$zxf $$doesn't often exercise, so he doesn't run fast. Although $$DH $$doesn't often exercise, he runs faster than $$zxf $$, but when $$DH $$sees that $$zxf $$is behind, he will stop and walk for a while to save energy. The time of each walk is one second,
Now $$JZK $$wants to know how many times $$zxf $$caught up with $$DH $$before he ran to the lab (including the same distance).
###Input format:
Input a total of one line, a line of four numbers $$a $$$$$B $$$$$C $$$$d $$, which respectively represent the speed of $$zxf $$running, $$DH $$running, $$DH $$walking speed and the distance from the laboratory.
$$(1 <= a,b,c <= 100,1 <= d <= 1000)$$
###Output format:
If $$zxf $$can catch up with $$DH $$before $$DH $$arrives at the laboratory, output "yes" in the first line and the number of times to catch up in the second line;
Otherwise, output "no"
###Input example:
Here is a set of inputs. For example:
```in
1 2 1 100
```
###Output example:
The corresponding output is given here. For example:
```out
NO
```
### tips:
The topic guarantees that $$a $< $$B $$, $$C $$< $$B $$, the unit of speed is per $$m / S $$, and the unit of laboratory distance is $$M $$. When $$DH $$decides whether to walk or run in this second, the action of this second will not change, even if $$zxf $$is about to surpass him, when he decides to run, it means that $$zxf $$exceeds $$DH $$, In the $$0 $$second, by default, two people are on the same running line, and $$DH $$will choose to run, but it can't count
If $$zxf $$exceeds $$DH $$, note that if $$DH $$arrives at the laboratory in the current second, but $$zxf $$exceeds him at this time, it does not mean that $$zxf $$exceeds $$DH $$.







answer:If there is no answer, please comment