/ 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 ii-th enemy appears at time lil_i and will reach the Bob at time rir_i. To avoid being dangerous, Bob has to eliminate it within the time period [li,ri)[l_i, r_i). Bob can use ultimate power to eliminate all enemies that have appeared at the cost of CC (units of) super energy. Unluckily, he has only EE 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 TT, denoting the number of test cases.

For each test case, the first line contains 3 integers nn, EE, CC, where nn is the number of enemies. Then nn lines follow, each line contains two integers lil_i, rir_i, whose meaning has been described above.

It is guaranteed that T20T \leq 20, n104n \leq 10^4, 0<E,C,li,ri1080 < 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%
上传者