In a world where ordinary people cannot reach, a boy named "Koutarou"and a girl
named "Sena" are playing a video game. The game system of this video game is quite
unique: inthe process of playing this game, you need to constantly face the
choice, each time you choose the game will provide 1−31-31−3 options, the player
can only choose one of them. Each option has an effect on a "score" parameter inthe game. Some options will increase the score, some options will reduce the score,
andsome options will change the score to a value multiplied by −1-1−1 .
That is, if there are three options in a selection, the score will be increased by111, decreased by111, or multiplied by −1-1−1. The score beforethe selection is888. Then selecting option 111 will make the score become 999, and selecting option
222 will make the score 777and select option 333to make the score −8-8−8. Note
thatthe score has an upper limit of100100100and a lower limit of −100-100−100.
If the score is999999at this time, an option that makes the score +2+2+2is
selected. After that, the score will change to100100100and vice versa .
After all the choices have been made, the score will affect the ending ofthe game.
If the score isgreater thanorequalto a certain value kkk, it will enter a good
ending; ifitisless than or equalto a certain value lll, it will enter the bad
ending; if both conditions are not satisfied, it will enter the normal ending. Now,
Koutarou and Sena want to play the good endings andthe bad endings respectively.
They refused to give up each other and finally decided to use the"one person to
make a choice" way to play the game, Koutarou first choose. Now assume that they
all know the initial score, the impact of each option, andthe kkk, lll values, and
decide to choose inthe way that works best for them. (That is, they will try their
best to play the ending they want. If it's impossible, they would rather normal
ending than the ending their rival wants.)
Koutarou and Sena are playing very happy, but I believe you have seen throughthe
final ending. Now give you the initial score, the kkk value, the lll value, andthe
effect of each option onthe score. Can you answer the final ending ofthe game?
【Input】
The firstlinecontainsfour integers n,m,k,ln,m,k,ln,m,k,l(1≤n≤10001\le n \le
10001≤n≤1000, −100≤m≤100-100 \le m \le 100−100≤m≤100 , −100≤l<k≤100-100 \le l < k
\le 100−100≤l<k≤100 ), represents thenumberof choices, the initial score, the
minimum score required to enter a good ending, andthe highest score required to
enter a bad ending, respectively.
Each ofthe next nnn linescontainsthree integers a,b,ca,b,ca,b,c(a≥0a\ge 0a≥0 ,
b≥0b\ge0b≥0 ,c=0c=0c=0or c=1c=1c=1),indicates the options that appear in this
selection,in which a=0a=0a=0 means there is no option to increase the score in this
selection, a>0a>0a>0 means there is an option in this selection to increase the
score by aaa ; b=0b=0b=0 means there is no option to decrease the score in this
selection, b>0b>0b>0 means there is an option in this selection to decrease the
score by bbb; c=0c=0c=0 means there is no option tomultiplythe score by −1-1−1in
this selection , c=1c=1c=1 means there is exactly an option in this selection tomultiplythe score by −1-1−1. It is guaranteed that a,b,ca,b,ca,b,c are not equal
to000atthe same time.
【Output】
One linecontainsthe final ending ofthe game. If it will enter a good
ending,print "Good Ending"(without quotes); ifit will enter a bad ending,print
"Bad Ending"(without quotes);otherwise print "Normal Ending"(without quotes).
2018-ACM-ICPC-徐州赛区网络赛-B. BE, GE or NE-博弈论+dp-记忆化搜索
2018-ACM-ICPC-徐州赛区网络赛-B. BE, GE or NE-博弈论+dp-记忆化搜索【Description】 In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The gam...