/ StarOI / 题库 /

Bob and DitF

Bob and DitF

Bob and DitF

Description

Bob loves the animation Darling in the Franxx, but the ending made him very upset. Today in his dream, he becomes the pilot of Strelitzia!

Suppose the \(i\)-th enemy appears at time \(l_i\) and will reach the Bob at time \(r_i\). To avoid being dangerous, Bob has to eliminate it within the time period \([l_i, r_i)\). Bob can use ultimate power to eliminate all enemies that have appeared at the cost of \(C\) (units of) super energy. Unluckily, he has only \(E\) super energy left.

Your task is to figure out whether Bob can eliminate all enemies or not.

Input

There are many test cases. The first line contains an integer \(T\), denoting the number of test cases.

For each test case, the first line contains 3 integers \(n\), \(E\), \(C\), where \(n\) is the number of enemies. Then \(n\) lines follow, each line contains two integers \(l_i\), \(r_i\), whose meaning has been described above.

It is guaranteed that \(T \leq 20\), \(n \leq 10^4\), \(0 < E, C, l_i, r_i \leq 10^8\).

Output

For each test case output one line. If the Bob can eliminate all enemies, you shall output "Good Ending" (without quotation marks). Otherwise, you shall output "Bad Ending" (without quotation marks).

Sample Case

Input

2
3 3 3
1 4
2 5
3 6
5 3 3
1 4
2 3
2 5
3 6
4 7

Output

Good Ending
Bad Ending

Explanation

For the first case, Bob needs to use ultimate power only once and energy is just enough for one use.

While for the second case, Bob has to use twice, but energy is not enough.

信息

难度
9
分类
贪心 点击显示
标签
(无)
递交数
9
已通过
3
通过率
33%
上传者