Don't Forget Us

0

0 votes
Medium-Hard
Problem

Alfred is going out on a business trip for a month and Andy is sad because she can't go with him since she has a few mammoth tasks to complete at her own office.

There is no denying the fact both of them will miss each other. But the question is who will miss the other one, more! Andy decides to answer this question by assigning a task to Alfred.

The task goes like this. She gives Alfred a "smart" random number in the form of a string S, where each digit D is between 0 and 9 inclusive. The number is considered "smart" if there are no leading zeroes.

For example 05 is not smart, but 5 is. Similarly, 00 is not smart but 0 is.

She wants to know, if after removing exactly R digits of the number, is it possible to form a "smart" number which is divisible by 3. If there exists such a number Andy will miss Alfred more otherwise Alfred will miss her.

Can you help Alfred and impede them from forgetting each other?

Input Format :

The first line of input contains T, denoting the number of test cases.

The second line of input contains the length of the string S and the number of digits to be deleted, R.

Third line contains the input string S.

Output Format :

For each testcase if such a number is possible print "Miss you Alfred" otherwise print "Miss you Andy" without quotes.

Constraints :

1 <= T <= 100

0 <= D < 10

1 <= N <= 2105

0 <= R < N

Author: Akshat Dua

Sample Input
3
5 2
35216
5 1
55663
4 3
2580
Sample Output
Miss you Alfred
Miss you Andy
Miss you Alfred
Time Limit: 0.7
Memory Limit: 256
Source Limit:
Explanation

1st test case :

Smart number that is divisible by 3 can be 351 or 516. Hence print "Miss you Alfred" without quotes.

2nd test case :

No Smart number that is divisible by 3 is possible. Hence print "Miss you Andy" without quotes.

3rd test case :

Smart number that is divisible by 3 is 0. Hence print "Miss you Alfred" without quotes.

Editor Image

?