#Lutece1269. ZhangYu Speech
ZhangYu Speech
Migrated from Lutece 1269 ZhangYu Speech
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
as we all know, ZhangYu(Octopus vulgaris) brother has a very famous speech - "Keep some distance from me". ZhangYu brother is so rich that everyone want to contact he, and scfkcf is one of them. One day , ZhangYu brother agreed with scfkcf to contact him if scfkcf could beat him. There are digits(lets give them indices from to and name them ) and some queries.
for each query:
- ZhangYu brother choose an index from to .
- For all indices ( < ) calculate the difference .
- Then ZhangYu brother calculate ,the sum of all by which are greater than , and scfkcf calculate , the sum of all by which are less than .
if , ZhangYu brother won and did not agree with scfkcf to contact him; else if is equals to , ZhangYu brother would ignore the result; else if < , ZhangYu brother lost and agreed with scfkcf to contact him.
Input
The first line contains two integers , denoting the number of digits and number of queries. The second line contains digits (without spaces) . Each of next lines contains single integer denoting the index for current query.
Output
For each of queries print "Keep some distance from me" if ZhangYu won, else print "Next time" if ZhangYu brother ignored the result, else print "I agree" if ZhangYu brother lost in a line - answer of the query.
Samples
10 3
0324152397
1
4
7
Next time
Keep some distance from me
I agree
Note
It's better to use "scanf" instead of "cin" in your code.
Resources
第七届ACM趣味程序设计竞赛第四场(正式赛)