#include<cstdio>//找能判断的情况,猜出差值规律
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long ll;
const int N=10000;
int a[N],b[N];
int main(){
int t;
scanf("%d",&t);
while(t--)
{
int n,k;
scanf("%d%d",&n,&k);
int l=k-1,r=n-k;
if((l-r)%2){printf("LYF\n");}
else {printf("BH\n");}
}
return 0;
}
Description
Once upon time there was a cute princess called JWliving in a castle. One day, the princess had been kidnapped by the robbers. The prince called BHbecame worried, he wanted to save the princess. So the prince BHand a soldier called LYFwent to save the princess.
There were N people standing in a row, including the princess and N-1 robbers,numbered 1 to N from left to right. You already know the princess’ number is K. BH and LYF must kill robbers before meeting the princess. BH and LYF were both very powerful, they took turns killing the robbers. On each turn, a man could kill the left most robber or kill the right most robber. The massacre would end until there was a man to save the princess. The princess would marry the man who saved her first. Assume that BH and LYF kill optimally and LYF kill first, determine the princess would be married to who.
There were N people standing in a row, including the princess and N-1 robbers,numbered 1 to N from left to right. You already know the princess’ number is K. BH and LYF must kill robbers before meeting the princess. BH and LYF were both very powerful, they took turns killing the robbers. On each turn, a man could kill the left most robber or kill the right most robber. The massacre would end until there was a man to save the princess. The princess would marry the man who saved her first. Assume that BH and LYF kill optimally and LYF kill first, determine the princess would be married to who.
Input
The first line of the input contains an integer T(T <= 500) which means the number of test cases.
For each test case, there are two integers n(3 <= n <= 1000000000) and k(1 < k < n) which mean the number of robbers and the princess’ position.
Output
Output a single line: if the princess would be married to the prince, print ”BH”(without quote), otherwise print ”LYF”(without quote).
Sample Input
5 3 2 4 3 5 2 6 4 6 5
Sample Output
BH LYF BH LYF LYF