Niko Plays PUBG

DiscoFighter47 Intra NSU Programming Con...
Limits 2s, 1.0 GB

Gone are those days when Niko used to be a noob PUBG player. Now he gets “Chicken Dinner” every now and then. But Barney Stinson said, “Whatever you do in this life, it is not legendary unless your friends are there to see it”. So, Niko wants to play PUBG with his school friends online.

To play PUBG together, players connect their PC’s via LAN cable. Two players can play together if their PC’s are connected by a serial of LAN cable(s). Now, given which PC’s are connected via LAN cable, help Niko and friends to find whether they can play PUBG together.


Input starts with an integer T (≤ 100), denoting the number of test cases.
Each case starts with a line containing three integers n (2 ≤ n ≤ 1000), m (0 ≤ m ≤ 10000) and q (1 ≤ q ≤ 10000) where n denotes the number of players, m denotes the number of PC pairs connected directly via a LAN cable and q denotes the number of time(s) Niko and his friends want to play. Each of the next m lines contains two integers u, v (1 ≤ u, v ≤ n, u ≠ v) meaning that player u and v connected their PCs via a LAN cable. Next q lines denote two integers a and b (1 ≤ a, b ≤ n, a≠b ) meaning player a and b want to play a match.


For each case, print the case number in a line first. Then for each match print “Chicken dinner coming soon!” if player a and b can play together, else print “Eat vegetables!”. See sample input/output for more info.


5 3 2
1 2
1 3
4 5
2 3
1 4
Case 1:
Chicken dinner coming soon!
Eat vegetables!


Login to submit.


76% Solution Ratio
fsshakkhorEarliest, Dec '18
Kuddus.6068Fastest, 0.0s
nusuBotLightest, 4.9 MB
foyaz05Shortest, 697B
Toph uses cookies. By continuing you agree to our Cookie Policy.