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

PROGRAMMING:Water Drinking

Luz5年前 (2021-05-10)题库431
A crow was thirsty, circled lowly to find water to drink. After searching for a long time, the crow finally found a water bottle not far away, and happily flew over, stopped at the mouth of the water bottle, ready to drink water happily. But there is too little water in the water bottle, and its mouth is small, its neck is long, and the crow cannot reach the water anyway.
............
The crow brought in many stones and threw them one by one into the bottle. With the increase of stones, the water in the water bottle slowly rises gradually.
Finally, the water in the water bottle rose to the mouth of the bottle, and the crow was finally able to drink it. The crow stood at the mouth of the water bottle and drank sweet and delicious water, his heart was so happy and comfortable.
![ timg.jpg](~/b01ad320-7a3e-4b96-bcb9-1f64da9b7f4f.jpg)
Supplied that the shape of the water bottle is always frustum, all the stones are the same and always can be put in the water bottle, please tell the crow whether the water will be overflowed and whether it can drink the water or not. If not, tell the crow how many stones need to find.
### Input Specification:
There are multiple test cases. The first line of the input contains an integer $$T$$, indicating the number of test cases. For each test case:
Each line contains seven integers, $$V_ 0$$, $$V$$, $$n$$, $$r$$, $$R$$, $$h$$, $$l$$ (1 ≤ $$V_ 0$$, $$V$$, $$r$$, $$R$$, $$h$$ ≤ $$10^5$$, 0 ≤ $$n$$, $$l$$ ≤ 1000), indicating the initial volume of the water, the volume of the stones, the amount of the stones, the top radius of the frustum, the bottom radius of the frustum, the height of the frustum, the length of the crow's mouth.
### Output Specification:
For each test case, if the water will be overflowed, print "Overflow!" ( without quotes), else if the crow can drink the water, print "Yeah!" ( without quotes), otherwise, print "Sorry, X stones needed." (without quotes) instead.
### Sample Input:
```in
two
100 2 50 3 6 4 2
50 1 50 3 6 4 1
```
### Sample Output:
```out
Yeah!
Sorry, 128 stones needed.
```
### Hint:
The volume formula of a frustum:
![ 1583775256(1).png](~/2d15a014-1837-4cb5-9d5d-f23e46c27f10.png)







answer:If there is no answer, please comment