当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
Joan is taking an internship at a company these days. Every day she is assigned tons of dull statistical jobs such as counting how many products made by the company values more than $100. In order to have more time to chat with the handsome intern nearby, she asks you to program a clever software that helps her get released from the onerous work.
The software should take as input a table of records together with several queries and for each query output all the records respectively.
The first part of the input is a single line consisting of three integers, m(1 ≤ m ≤ 10), n(1 ≤ n ≤ 10000), k(1 ≤ k ≤ 100) indicating the number of columns in the table, the number of records and the number of queries.
The second part of the input is the description of the table, which consists of m lines. The i-th line of this part consists two strings in the format Column_Name Type which describes the i-th column of the table.
The third part of the input shows the content of the table which contains n lines. The i-th line of this part shows the i-th record in the table which consists of m items.
The last part of the input gives the k queries which are similar to SQL select statements. The query is in the format select Column_List where Condition
The size of the input will not exceed 1M bytes.
For each query output a table and a blank line as Sample Output shows.
3 10 4 SID INT NAME STR PRIZE INT 1000 Potion 50 1001 Phoenix_Down 150 1002 Remedy 300 1003 Dagger 320 1004 Rod 260 1005 Flame_Staff 1100 1006 Broad_Sword 330 1007 Fork 1100 1008 Javelin 880 1009 Cats_Claws 4000 select SID,NAME,PRIZE where PRIZE>100 select SID,SID where NAME="Dagger" select PRIZE where NAME="Rod" select SID,NAME,PRIZE where NAME="Excalibur"
+-----------------------------+
| SID | NAME | PRIZE |
|------|--------------|-------|
| 1001 | Phoenix_Down | 150 |
| 1002 | Remedy | 300 |
| 1003 | Dagger | 320 |
| 1004 | Rod | 260 |
| 1005 | Flame_Staff | 1100 |
| 1006 | Broad_Sword | 330 |
| 1007 | Fork | 1100 |
| 1008 | Javelin | 880 |
| 1009 | Cats_Claws | 4000 |
+-----------------------------+
+-------------+
| SID | SID |
|------|------|
| 1003 | 1003 |
+-------------+
+-------+
| PRIZE |
|-------|
| 260 |
+-------+
+--------------------+
| SID | NAME | PRIZE |
|-----|------|-------|
+--------------------+
时间上限 | 内存上限 |
1000 | 65536 |