Nguyên Tố Fibonacci

PDF

Submit solution

Points: 10.00
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Authors:
Problem types
Allowed languages
C, C++, Java, Pascal, Python, Scratch, TEXT

Dãy số Fibonacci có dạng: $$F_n=F_{n-1}+F_{n-2}$$ $$F_1=F_2=1$$

Yêu cầu

Nhập vào số nguyên ~n~, tìm số ~F~ thuộc dãy Fibonacci sao cho:

  • ~F~ là số nguyên tố.
  • ~F~ lớn nhất mà vẫn không lớn hơn ~n~.

Dữ liệu

Một dòng duy nhất, gồm số nguyên ~n~ ~(0< n\le 10^5)~.

Kết quả

Ghi ra số ~F~ tìm được, nếu không tìm được, ghi ra None.

Input

6

Output

5

Comments

Please read the guidelines before commenting.


There are no comments at the moment.