#P8646. [蓝桥杯 2017 省 AB] 包子凑数
[蓝桥杯 2017 省 AB] 包子凑数
Description
Xiaoming eats breakfast at a baozi shop almost every morning. He found that the shop has types of steamers. The -th type of steamer can hold exactly baozi. There are many steamers of each type, which can be considered unlimited.
Whenever a customer wants to buy baozi, the seller will quickly choose some steamers so that the total number of baozi in these steamers is exactly . For example, there are types of steamers that can hold , , and baozi. When a customer wants to buy baozi, the seller will choose steamers of plus steamer of (or he may choose steamer of plus steamers of ).
Of course, sometimes the seller cannot make up the number the customer wants, no matter what. For example, there are types of steamers that can hold , , and baozi. When a customer wants to buy baozi, the seller cannot make it.
Xiaoming wants to know how many amounts cannot be made up by the seller.
Input Format
The first line contains an integer . .
The next lines each contain an integer . .
Output Format
Output an integer as the answer. If there are infinitely many amounts that cannot be made up, output INF.
2
4
5
6
2
4
6
INF
Hint
For sample , the amounts that cannot be made up include: .
For sample , all odd numbers cannot be made up, so there are infinitely many.
Lanqiao Cup 2017 Provincial Contest, Group A, Problem H.
Translated by ChatGPT 5
京公网安备 11011102002149号