Number Game
题意翻译
有一个正整数 $n$。
两名玩家轮流操作。每次操作可以执行以下一种:
- 将 $n$ 除以一个 $n$ 的大于 $1$ 的奇数因子。
- 将 $n$ 减去 $1$(若 $n\gt1$)。
无法操作者输。
问先手是否有必胜策略。如果先手有必胜策略,输出 `Ashishgup `,否则输出 `FastestFinger `。
多组数据,数据组数 $t \leq 100$,$1 \leq n \leq 10^9$
翻译 by Meatherm
题目描述
Ashishgup and FastestFinger play a game.
They start with a number $ n $ and play in turns. In each turn, a player can make any one of the following moves:
- Divide $ n $ by any of its odd divisors greater than $ 1 $ .
- Subtract $ 1 $ from $ n $ if $ n $ is greater than $ 1 $ .
Divisors of a number include the number itself.
The player who is unable to make a move loses the game.
Ashishgup moves first. Determine the winner of the game if both of them play optimally.
输入输出格式
输入格式
The first line contains a single integer $ t $ ( $ 1 \leq t \leq 100 $ ) — the number of test cases. The description of the test cases follows.
The only line of each test case contains a single integer — $ n $ ( $ 1 \leq n \leq 10^9 $ ).
输出格式
For each test case, print "Ashishgup" if he wins, and "FastestFinger" otherwise (without quotes).
输入输出样例
输入样例 #1
7
1
2
3
4
5
6
12
输出样例 #1
FastestFinger
Ashishgup
Ashishgup
FastestFinger
Ashishgup
FastestFinger
Ashishgup
说明
In the first test case, $ n = 1 $ , Ashishgup cannot make a move. He loses.
In the second test case, $ n = 2 $ , Ashishgup subtracts $ 1 $ on the first move. Now $ n = 1 $ , FastestFinger cannot make a move, so he loses.
In the third test case, $ n = 3 $ , Ashishgup divides by $ 3 $ on the first move. Now $ n = 1 $ , FastestFinger cannot make a move, so he loses.
In the last test case, $ n = 12 $ , Ashishgup divides it by $ 3 $ . Now $ n = 4 $ , FastestFinger is forced to subtract $ 1 $ , and Ashishgup gets $ 3 $ , so he wins by dividing it by $ 3 $ .