#P5993. [PA 2014] Iloczyn

[PA 2014] Iloczyn

Description

The Fibonacci sequence is defined as follows:

  • When k=0k = 0 or 11, Fk=kF_k = k.

  • When k>1k > 1, Fk=Fk1+Fk2F_k = F_{k - 1} + F_{k - 2}.

The first few terms of the sequence are 0,1,1,2,3,5,8,13,21,34,55,0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, \dots.

Your task is to determine whether a given number can be represented as the product of two Fibonacci numbers.

Input Format

The first line contains an integer TT, representing the number of queries.

The next TT lines each contain an integer nin_i.

Output Format

Output a total of TT lines. The ii-th line should be TAK (yes) or NIE (no), indicating whether nin_i can be represented as the product of two Fibonacci numbers.

5
5
4
12
11
10
TAK
TAK
NIE
NIE
TAK

Hint

For 100%100\% of the testdata, 1T101 \le T \le 10, 0ni1090 \le n_i \le 10^9.

Translated by ChatGPT 5