0
点赞
收藏
分享

微信扫一扫

codeforces 441A Valera and Antique Items


A. Valera and Antique Items



time limit per test



memory limit per test



input



output



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

n sellers of antiques, the i-th of them auctioned ki items. Currently the auction price of the j-th object of the i-th seller is sij. Valera gets on well with each of the n

v units of money. Help him to determine which of the n



Input



n, v (1 ≤ n ≤ 50; 104 ≤ v ≤ 106)

n lines follow. The i-th line first contains integer ki (1 ≤ ki the number of items of the i-th seller. Then go ki space-separated integers si1, si2, ..., siki (104 ≤ sij ≤ 106) — the current prices of the items of the i-th seller.



Output



p

p space-separated integers q1, q2, ..., qp (1 ≤ qi ≤ n) — the numbers of the sellers with who Valera can make a deal. Print the numbers of the sellers in the increasing order.



Examples



input



3 50000 1 40000 2 20000 60000 3 10000 70000 190000



output



3 1 2 3



input



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



output



0



Note



40000 item from the first seller, a 20000 item from the second seller, and a 10000

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.



题我没翻译明白,唉~,还是英语不好,翻译清楚了,就明白有多简单了。

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
int n,v;
cin>>n>>v;
int a[100],t=0;
for(int i=0; i<n; i++)
{
int k,x;
bool flag=false;
cin>>k;
for(int j=0; j<k; j++)
{
cin>>x;
if(v>x)
flag=true;
}
if(flag)
a[t++]=i+1;
}
cout<<t<<endl;
for(int i=0; i<t; i++)
{
if(i==0)
cout<<a[i];
else
cout<<" "<<a[i];
}
if(t)
cout<<endl;
return 0;
}




举报

相关推荐

0 条评论