Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/funksiya-fibonachchimi

Is it a Fibonacci number

Easy 1000 ms 128 MB 32%
Share

Write a function IsFibonacci(x) that returns true if the non-negative integer $x$ is a Fibonacci number and false otherwise. The Fibonacci numbers start with $0$ and $1$, and each next one is the sum of the previous two: $0, 1, 1, 2, 3, 5, 8, 13, \ldots$

Example 1: IsFibonacci(13) → true

Example 2: IsFibonacci(4) → false

Write only the function body.

A number goes into the function IsFibonacci, which returns true

Input

One line with a non-negative integer $x$ — the argument of the function.

Output

The value returned by the function: true or false.

Note

$0 \le x \le 10^{15}$

Examples

Input #1
13
Output #1
true
Input #2
4
Output #2
false

Sign in to submit a solution

Signing up is free and takes a minute.