Pile of Coins
Practice
3.7 (21 votes)
Basic programming
Basics of implementation
Easy
Game theory
Implementation
Logic Based
Logical reasoning
Problem
68% Success 3805 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Ashish and Jeel are playing a game. They are given two piles of coins with P and Q coins respectively. They take alterate turns. During each turn, the player can choose one pile and split it into two non-zero parts and discard the other pile that is not choosen. The discarded pile cannot be used further in the game. A player loses if he cannot make a move. Both the players play the game optimally.
You are given P and Q. Determine who wins the game if Ashish plays first.

Input format

  • First line: An integer T denoting the number of test cases
  • Next T lines: Two integers P and Q

Output format

For each test case, print the winner of the game "Ashish" or "Jeel" (without quotes).
Answer for each test case should come in a new line.

Input Constraints

1T10

1P,Q106

 

Sample Input
3
1 1
1 2
2 2
Sample Output
Jeel
Ashish
Ashish
Explanation

In the first case, Ashish has no possible moves because both the piles are of size 1, hence Jeel wins.

In the other 2 cases, Ashish can take the pile of size 2 and split it into (1, 1) and discard the other pile. Jeel cannot make any move on (1, 1) piles, so Ashish wins.

Code Editor

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Submissions
Please login to view your submissions
Similar Problems
Points:20
95 votes
Tags:
EasyImplementation
Points:20
8 votes
Tags:
ApprovedEasyImplementationapproved
Points:20
33 votes
Tags:
Ad-HocApprovedData StructuresEasyImplementationOpen
Editorial

Login to unlock the editorial