logo AlgoBeat OnlineJudge
登录 注册

#216510. [GKS 2013 Practice] Bad Horse

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

As the leader of the Evil League of Evil, Bad Horse has a lot of problems to deal with. Most recently, there have been far too many arguments and far too much backstabbing in the League, so much so that Bad Horse has decided to split the league into two departments in order to separate troublesome members. Being the Thoroughbred of Sin, Bad Horse isn't about to spend his valuable time figuring out how to split the League members by himself. That what he's got you -- his loyal henchman -- for.

输入格式

The first line of the input gives the number of test cases, . test cases follow. Each test case starts with a positive integer on a line by itself -- the number of troublesome pairs of League members. The next lines each contain a pair of names, separated by a single space.

输出格式

For each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is either "Yes" or "No", depending on whether the League members mentioned in the input can be split into two groups with neither of the groups containing a troublesome pair.

样例

样例输入 1

2
1
Dead_Bowie Fake_Thomas_Jefferson
3
Dead_Bowie Fake_Thomas_Jefferson
Fake_Thomas_Jefferson Fury_Leika
Fury_Leika Dead_Bowie

样例输出 1

Case #1: Yes
Case #2: No

数据范围与提示

Limits

.

Each member name will consist of only letters and the underscore character.

Names are case-sensitive.

No pair will appear more than once in the same test case.

Each pair will contain two distinct League members.

Small dataset

.

Large dataset

.