P16277 「MierOI R1」Past

Description

Given a positive integer $n$, determine whether there exist a **palindromic number$^{\bm{\dagger}}$** $a$ and a non-negative integer $b$ such that $a+2^b=n$. --- $\bm \dagger$ A **non-negative integer** is called a palindromic number if and only if it reads the same forwards and backwards.

Input Format

**This problem contains multiple test cases.** The first line of the input contains a positive integer $T$, indicating the number of test cases. Then, the $T$ test cases follow sequentially. For each test case: - One line containing a single positive integer $n$.

Output Format

For each test case, output a single line: - If there exist $a,b$ satisfying the condition, output `Yes`. - If there do not exist $a,b$ satisfying the condition, output `No`.

Explanation/Hint

#### Explanation for Sample #1 For the first test case, we have $a=11$, $b=2$, and $n=11+2^2=15$. For the second test case, it can be proven that there do not exist $a,b$ satisfying the conditions. For the third test case, we have $a=57\,675$, $b=9$, and $n=57\,675+2^9=58\,187$. #### Data Range **This problem uses bundled subtasks.** For all test cases, it is guaranteed that $1 \le T \le 10^4$ and $1 \le n \le 10^{18}$. ::cute-table{tuack} | Subtask | $T \le$ | $n \le$ | Score | |:-:|:-:|:-:|:-:| | $1$ | $10$ | $10^3$ | $30$ | | $2$ | ^ | $10^6$ | $30$ | | $3$ | $10^4$ | $10^{18}$ | $40$ |