题库练习 Boom
← 上一题 下一题 →

A8350 | Boom

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

The first line contains two integers $n,t$ $(1<=n,t<=100)$ , which correspondingly denote the number of teams and a turn's duration.

Next $n$ lines of the input file contain four integers each: $a_{i1},b_{i1},a_{i2},b_{i2}$ $(1<=a_{ij},b_{ij}<=100)$ — the skills of the first and the second player of the $i$ -th team. The teams are given in the order in which they play.

The next line of the input file contains integer $m$ $(1<=m<=100)$ the number of cards.

Next $2m$ lines contain the cards' descriptions. Two lines describe each card. The first line of the description contains the word that consists of no more than 20 characters. The words only contain small Latin letters. The second line of the description contains an integer $c_{k}$ ( $1<=c_{k}<=100$ ) — the complexity of the word written on the $k$ -th card. The cards are listed in the order in which the lie in the deck from top to bottom. The words on all cards are different.

输入格式

Print $n$ lines. On the $i$ -th line first print number $s_{i}$ the number of points the $i$ -th team wins. Then print $s_{i}$ space-separated words — the words from the cards guessed by team $i$ in the order in which they were guessed.

输出格式

无

输入输出样例

输入 #1
2 2
1 1 1 1
1 1 1 1
3
home
1
car
1
brother
1
输出 #1
2 home car 
1 brother 
输入 #2
2 4
1 2 2 1
2 3 2 2
4
armchair
3
quetzalcoatl
10
pilotage
5
defibrillator
7
输出 #2
2 armchair quetzalcoatl 
2 pilotage defibrillator 
C++ 编辑器
输入
输出