CF1811D.Umka and a Long Flight
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The girl Umka loves to travel and participate in math olympiads. One day she was flying by plane to the next olympiad and out of boredom explored a huge checkered sheet of paper.
Denote the n -th Fibonacci number as Fn=⎩⎨⎧1,1,Fn−2+Fn−1,n=0;n=1;n≥2.
A checkered rectangle with a height of Fn and a width of Fn+1 is called a Fibonacci rectangle of order n .
Umka has a Fibonacci rectangle of order n . Someone colored a cell in it at the intersection of the row x and the column y .
It is necessary to cut this rectangle exactly into n+1 squares in such way that
- the painted cell was in a square with a side of 1 ;
- there was at most one pair of squares with equal sides;
- the side of each square was equal to a Fibonacci number.
Will Umka be able to cut this rectangle in that way?
输入格式
The first line contains an integer t ( 1≤t≤2⋅105 ) — number of test cases.
For each test case the integers n , x , y are given ( 1≤n≤44 , 1≤x≤Fn , 1≤y≤Fn+1 ) — the order of the Fibonacci rectangle and the coordinates of the colored cell.
输出格式
For each test case, print "YES" if the answer is positive, and "NO" otherwise.
You can print "YES" and "NO" in any case (for example, the strings "yEs", "yes" and "Yes" will be recognized as a positive answer).
输入输出样例
输入#1
12 1 1 1 2 1 2 3 1 4 3 3 2 4 4 6 4 3 3 5 6 5 5 4 12 5 2 12 4 2 1 1 1 2 44 758465880 1277583853
输出#1
YES NO YES YES YES NO YES NO NO YES YES NO
说明/提示
The first, third and fourth test cases.