CHTCHTCHEAT - Cheating!!
Let's read a popular Story.
Once upon a time there lived, a lazy boy whose name was Som. In olden days in a test paper of any language there used to be one question, which was "write an essay on topic 'xyz'".
Now this 'xyz' could be any thing.That was to test the vocabulary and general knowledge of the students.
Since our Som was a lazy boy, he decided to write only one essay.
The essay of a cow.That would read as follows:
"Cow is a domesticated animal. She helps mankind in many ways. Her milk is very healthy for babies. Cows usually eat green grass but they can survive on other things too. Blah blah blah."
So he would read the test paper. If the essay is about 'train' he would write as follows:
"A train is a form of rail transport consisting of many compartments. When we sit beside a window in a train, we can see many cows grazing in the fields. Cow is a domesticated animal. She helps mankind in many ways..."
If the essay is about 'Gandhi' he would write "Gandhi was an Indian leader. He loved cows. Cow is a domesticated animal. She helps mankind in many ways..."
If the essay is about a cat, he would write. "Cat drinks milk. The milk comes from a cow. Cow is a domesticated animal. She helps mankind in many ways..."
So he has this knack of converting any essay into 'essay of a cow'.
After reading this popular story, nowadays many students are following this great technique and it becomes a problem for a teacher to detect the cheating. So, your task is just write a program to detect this cheating.
Input
The first line will contain an integer T (0 < T < 50) which denotes the number of test cases. For T cases, there will be a string S (lowercase string with fewer than 25 characters) which denotes the name of the essay. Then in the next line there will be an integer N (N < 100) which denotes the number of lines of the essay. Then there will be N number of lines. In each line, A sentence will be given (each sentence length is less than 100).
Output
For each input, if you find any sentence comes from the given cow's essay then print "Cheating" else "Not cheating". But if the essay is about cow then it is okay to use sentences from the cow's essay, in that case print "Not cheating".
Example
Input: 3 cow 3 Cow is a domesticated animal. She helps mankind in many ways. Her milk is very healthy for babies. gandhi 3 Gandhi was an Indian leader. He loved cows. Cow is a domesticated animal. cat 4 Cat drinks milk. The milk comes from a cow. Cats are familiar and easily kept animals Cats can hear sounds too faint or too high. Output: Not cheating Cheating Not cheating
Added by: | Sarwar |
Date: | 2018-05-26 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |