水了,,

#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.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值