Problem E
Find my Family

You are looking for a particular family photo with you and
your favorite relatives Alice and Bob. Each family photo
contains a line-up of
Since you have a large number of family photos, you want to
use your computer to assist in finding the photo. Many of the
photos are quite blurry, so facial recognition has proven
ineffective. Luckily, the Batch Apex Photo Classifier, which
detects each person in a photo and outputs the sequence of
their (distinct) heights in pixels, has produced excellent
results. Given this sequence of heights for
Input
-
The first line contains
, the number of photos you have to process. -
Then follow two lines for each photo.
-
The first line contains a single integer
, the number of people on this photo. -
The second line contains
distinct integers , the heights of the people in the photo, from left to right.
-
It is guaranteed that the total number of people in all
photos is at most
Output
-
On the first line, output the number of photos
that need further investigation. -
Then print
lines each containing a single integer , the sorted indices of the photos you need to look at.
Sample Input 1 | Sample Output 1 |
---|---|
1 3 2 1 3 |
1 1 |
Sample Input 2 | Sample Output 2 |
---|---|
4 4 140 157 160 193 5 15 24 38 9 30 6 36 12 24 29 23 15 6 170 230 320 180 250 210 |
2 2 4 |