Biến Đổi Cặp Số
Nộp bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Đầu vào:
stdin
Đầu ra:
stdout
Tác giả:
Dạng bài
Ngôn ngữ cho phép
C++, Go, Java, Kotlin, Pascal, Python, Scratch
Bessie likes cooking and wants to prepare a meal. She has a number of recipes and wants to pick one to use. However, she has a difficult time deciding between recipes, and she will cook the meal from the recipe that is chosen by a fair game.
This game involves a list of pairs of integers. Each pair of integers has some information written on it. In each step of the game, Bessie picks a pair and performs one of two operations on it:
- Operation A:
- Operation B:
The game continues until all pairs are of the form for some integer , where is the -th Fibonacci number.
How many pairs can Bessie modify?
Dữ liệu vào
Dòng đầu tiên chứa (), số lượng cặp.
dòng tiếp theo, mỗi dòng chứa hai số nguyên và ().
Dữ liệu ra
In ra số lượng cặp mà Bessie có thể biến đổi thành dạng .
Ràng buộc
Ví dụ
| Input | Output | Giải thích |
|---|---|---|
21 13 5 |
2 |
Cả hai cặp đều là Fibonacci |
31 25 82 2 |
2 |
Chỉ hai cặp (1,2) và (5,8) là Fibonacci |
Bình luận