Codeforces Round 217 (Div. 2)
B
Berland Bingo
Codeforces
1300
原题
← AC →
翻译中…

Lately, a national version of a bingo game has become very popular in Berland. There are $*n*$ players playing the game, each player has a card with numbers. The numbers on each card are distinct, but distinct cards can have equal numbers. The card of the $*i*$-th player contains $*m*_{*i*}$ numbers.

翻译中…

During the game the host takes numbered balls one by one from a bag. He reads the number aloud in a high and clear voice and then puts the ball away. All participants cross out the number if it occurs on their cards. The person who crosses out all numbers from his card first, wins. If multiple people cross out all numbers from their cards at the same time, there are no winners in the game. At the beginning of the game the bag contains 100 balls numbered 1 through 100, the numbers of all balls are distinct.

翻译中…

You are given the cards for each player. Write a program that determines whether a player can win the game at the most favorable for him scenario or not.

翻译中…

Input

翻译中…

The first line of the input contains integer $*n*$ ($1 ≤ *n* ≤ 100$) — the number of the players. Then follow $*n*$ lines, each line describes a player's card. The line that describes a card starts from integer $*m*_{*i*}$ ($1 ≤ *m*_{*i*} ≤ 100$) that shows how many numbers the $*i*$-th player's card has. Then follows a sequence of integers $*a*_{*i*, 1}, *a*_{*i*, 2}, ..., *a*_{*i*, *m*_{*i*}}$ ($1 ≤ *a*_{*i*, *k*} ≤ 100$) — the numbers on the $*i*$-th player's card. The numbers in the lines are separated by single spaces.

翻译中…

It is guaranteed that all the numbers on each card are distinct.

翻译中…

Output

翻译中…

Print $*n*$ lines, the $*i*$-th line must contain word "YES" (without the quotes), if the $*i*$-th player can win, and "NO" (without the quotes) otherwise.

翻译中…

样例

Input #1
3
1 1
3 2 4 1
2 10 11
Output #1
YES
NO
YES
InputCopy OutputCopy
Input #2
2
1 1
1 1
Output #2
NO
NO
InputCopy OutputCopy
题目信息
题号
370B
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。