Timer is Running

Akash and Friend
Submissions: 946   Accuracy:


  Difficulty: Basic   Marks: 1

Akash is good at mathematics and games. He also has a nature of boasting about it. He invites his best friend to dinner and ask him to play his newly invented game.

He presents N numbers and an integer K. The game goes like this:

Each player will be given turn one by one. In each of their turn they can choose any number (non-zero) from the given array and divide (Integer division) it with K. The player who is unable to complete his move looses. Akash is very confident about his skills and knowledge about the game so he gives the first chance to his friends.


The first line of the input contains an integer T, denoting the number of test cases. The first line of each test case contains two integers N and K. The second line contains N space separated integers.

For each test case, Print the name of person who loses the game. Print “Friend” if Akash wins else “Akash”.


3 2
1 2 3

** For More Input/Output Examples Use 'Expected Output' option **

Author: ShivamKD

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.