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

PROGRAMMING:GG's supermarket

Luz5年前 (2021-05-10)题库393
GG has a supermarket. There are two employees in the supermarket. They are small a delivering goods and small B placing goods. The supermarket has a hall and a warehouse. There is a shelf in the hall. The shelf has only one opening, which can put or take goods; There is a conveyor belt in the warehouse, which will transport the goods put in the front door to the back door. Xiao a's job is to deliver the goods one by one to the front door of the warehouse every morning; Xiao B's job is to take out the goods one by one from the back door of the warehouse and put them on the shelves in the hall every morning. Generally speaking, he puts the new goods at the bottom of the shelves, but Xiao B is very lazy and puts the goods at the front every time; Customers come to the supermarket every day. GG occasionally checks the goods at the end of a day's business. If it is found that the first item on the shelf was purchased three days ago, GG will get angry and empty the shelf.
###Input format:
In the first line, give n (n < = 100), which represents the total number of days, and then n represents what happens every day.
The first number in each line represents the day, and the number of days is in order
The second number in each line represents the purchase quantity of Xiao a today, ranging from 0 to 1000
The third number in each line represents the quantity of goods put on the shelf by Xiao B today, ranging from 0 to 1000
The fourth number in each line represents how many goods customers have bought today, ranging from 0 to 1000
The fifth number in each line represents whether GG is here today, 1 represents it, and 0 represents it
The numbers are separated by spaces
The data does not guarantee that the pickup quantity of small B is less than the warehouse surplus quantity and the shelf surplus quantity is less than the estimated purchase quantity
###Output format:
If GG gets angry one day, it will add a string "Wang! Wang!! Wang!!!"。
Example: when GG gets angry at the spot check on the third day, it outputs "3 Wang! Wang!! Wang!!!”.
###Input example:
Here is a set of inputs. For example:
```in
five
1 10 4 3 0
2 10 4 4 0
3 0 5 5 0
4 0 1 1 1
5 0 0 0 0
```
###Output example:
The corresponding output is given here. For example:
```out
4 Wang! Wang!! Wang!!!
```






answer:If there is no answer, please comment