CF441A.Valera and Antique Items

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Valera is a collector. Once he wanted to expand his collection with exactly one antique item.

Valera knows nn sellers of antiques, the ii -th of them auctioned kik_{i} items. Currently the auction price of the jj -th object of the ii -th seller is sijs_{ij} . Valera gets on well with each of the nn sellers. He is perfectly sure that if he outbids the current price of one of the items in the auction (in other words, offers the seller the money that is strictly greater than the current price of the item at the auction), the seller of the object will immediately sign a contract with him.

Unfortunately, Valera has only vv units of money. Help him to determine which of the nn sellers he can make a deal with.

输入格式

The first line contains two space-separated integers n,vn,v (1<=n<=50; 104<=v<=106)(1<=n<=50; 10^{4}<=v<=10^{6}) — the number of sellers and the units of money the Valera has.

Then nn lines follow. The ii -th line first contains integer kik_{i} (1<=ki<=50)(1<=k_{i}<=50) the number of items of the ii -th seller. Then go kik_{i} space-separated integers si1,si2,...,sikis_{i1},s_{i2},...,s_{iki} (104<=sij<=106)(10^{4}<=s_{ij}<=10^{6}) — the current prices of the items of the ii -th seller.

输出格式

In the first line, print integer pp — the number of sellers with who Valera can make a deal.

In the second line print pp space-separated integers q1,q2,...,qpq_{1},q_{2},...,q_{p} (1<=qi<=n)(1<=q_{i}<=n) — the numbers of the sellers with who Valera can make a deal. Print the numbers of the sellers in the increasing order.

输入输出样例

  • 输入#1

    3 50000
    1 40000
    2 20000 60000
    3 10000 70000 190000
    

    输出#1

    3
    1 2 3
    
  • 输入#2

    3 50000
    1 50000
    3 100000 120000 110000
    3 120000 110000 120000
    

    输出#2

    0
    
    

说明/提示

In the first sample Valera can bargain with each of the sellers. He can outbid the following items: a 4000040000 item from the first seller, a 2000020000 item from the second seller, and a 1000010000 item from the third seller.

In the second sample Valera can not make a deal with any of the sellers, as the prices of all items in the auction too big for him.

首页