F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Problem D

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1    Accepted Submission(s): 1


Problem Description
There is an infinite integer sequence $f_1,f_2,f_3,\dots$, where $f_1=1,f_2=2,f_i=f_{i-1}+f_{i-2}(i\geq 3)$.

You are given two positive integers $n$ and $k$, your task is to check whether $n$ can be split into $k$ integers $a_1,a_2,\dots,a_k$, where $a_1,a_2,\dots,a_k\in f$ and $a_1+a_2+\dots+a_k=n$. Note that you can split $n$ into same integers, for example, $10=5+5=f_4+f_4$.
 

Input
The first line of the input contains an integer $T(1\leq T\leq 100000)$, denoting the number of test cases.

In each test case, there is one integer $n(1\leq n,k\leq 10^{18})$ in the first line.
 

Output
For each test case, print a single line. If it is possible to split $n$ into $k$ integers, print Yes, otherwise print No.
 

Sample Input
4 10 1 10 2 5 1 12 2
 

Sample Output
No Yes Yes No
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2025-03-28 21:24:43, Gzip enabled