CF120G.Boom

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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

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

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

Next 2m2m 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 ckc_{k} ( 1<=ck<=1001<=c_{k}<=100 ) — the complexity of the word written on the kk -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 nn lines. On the ii -th line first print number sis_{i} the number of points the ii -th team wins. Then print sis_{i} space-separated words — the words from the cards guessed by team ii 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 
    
首页