You are given the following:
Your task is to construct the complement set of G based on the natural numbers, which implies that a number l∈G′ if and only if l∉G.
If the cardinality of G′ is finite, then print FINITE. Otherwise, print INFINITE. There are multiple test cases.
Mathematics note
Input format
Output format
For each test case, print the string FINITE or INFINITE in a single line.
Constraints
1≤ sum of n over all the test cases ≤100000
If k∈S, then 1≤k≤100000
The sample has two test cases.
In first testcase, we have the information that f(x)=x,f2(x)=x,f4(x)=x, Note that, from f(x)=x we can show that fm(x)=x, ∀m∈N. First, let us prove that f3(x)=x holds. f(f(f(x)))=f(f(x))=f(x)=x⟹f3(x)=x, where we used the fact f(x)=x repeatedly. In a similar manner, we can prove the claim that fm(x)=x∀m∈N. Hence, we get that for all m∈N, m∈G. Thus, G′ is an empty set, and the answer is FINITE.
In the second testcase, we will prove that the set G is exactly all the even positive numbers, i.e. f2m(x)=x. We can get this claim from a similar inductive argument as above. Now, all we need to prove is that odd numbers are not part of G. Consider the simple function f(x)=1−x, which satisfies the condition for all even positive integers (hence it belongs to class FUNC), but it does not satisfy f2m−1(x)=x for any positive integer m. Hence, G′, the complement of G is exactly the set of odd numbers, and thus the answer is INFINITE.
Updated problem name
Finite or infinite sets
Updated problem statement
You are given the following:
Your task is to construct the complement set of G based on the natural numbers, which implies that a number l∈G′ if and only if l∉G.
If the cardinality of G′ is finite, then print FINITE. Otherwise, print INFINITE. There are multiple test cases.
Mathematics note
Input format
Output format
For each test case, print the string FINITE or FINITE in a single line.
Constraints
1≤ sum of n over all test cases ≤100000
If k∈S, then 1≤k≤100000