12388 - Heatstroke Bamboo Rats   

Description

This bamboo rat seems to have heatstroke, we might as well ......

── Brothers HuaNong

Brothers HuaNong feed a lot of bamboo rats. They do love to eat bamboo rats! However, some of the rats seems to have heatstroke. Brothers HuaNong couldn't bear to watch them suffer, and we all know how Brothers HuaNong treat those heatstroke rats...


Every bamboo rat has its level of heatstroke(中暑程度), Brother HuaNong would randomly choose a number . If there's a rat with level of heatstroke equals to , Brother HuaNong would think that the rat has heatstroke and eat it.

You are hired by Brothers HuaNong. Brothers HuaNong will give you the level of heatstroke of every bamboo rats and several numbers . Your task is to help them find out if there's rats that have heatstroke.

Hint: construct a binary search tree.


This problem is partial judge. You are going to implement the following functions:

  1. void build_tree(Node **now, int *arr, int l, int r)

    When this function is called, you should build a binary search tree by the array arr.

  2. int query_heatstroke(Node *now, int x)

    This function is used to ask if there exists a node with level equals to .

  3. void eat_rat(Node **root, int x)

    This function will delete one node with level equals to .


Take sample as an example, initially, the level of heatstroke of the rats would be .

Firstly, , they will eat a rat with level equals 8. The sequence becomes .

: eat a rat with level equals to 10. The sequence becomes .

: eat a rat with level equals to 10. The sequence becomes .

: no rat with level equals to 200.

: no rat with level equals to 10(since all rats with level 10 are eaten).

Input

The first line is an integer , which indicates the number of bamboo rats.

The next line contains integers, indicate the level of heatstroke of every bamboo rat sorted in ascending order.

The third line is an integer , which means there are queries below.

There are lines below. Each line contains exactly one integer .

, , , the level of bamboo rats have the same range as .

Output

For each query , output "We might as well eat it." if there's a rat with level of heatstroke , otherwise output "No dinner tonight."

Sample Input  Download

Sample Output  Download

Partial Judge Code

12388.c

Partial Judge Header

12388.h

Tags




Discuss