Problem Author: | Haidara Al Makdid |
Prepared by: | Haidara Al Makdid |
Edited by: | Hasan Saleh (MathModel) |
Solution
Claim : Every integer n \ge 2 satisfies f(n)=2
Let denote the number of divisors of . Consider the sequence defined by x_0 = n and x_{k+1} = d(x_k).
For all integers n \gt 2, the inequality 2 \le d(n) < n holds.
Lower Bound: Since and are distinct divisors of for any n \ge 2, we have d(n) \ge 2.
Upper Bound: The divisors of are a subset of \{1, 2, \dots, n\}. For n > 2, n-1 does not divide (since n < 2(n-1)). Thus, the set of divisors is a proper subset of \{1, 2, \dots, n\}, implying d(n) < n.
Every integer sequence defined by x_0 = n (n > 2) and x_{k+1} = d(x_k) eventually reaches the fixed point 2.
Assume n > 2. By the Lemma, if x_k > 2, then:
This defines a strictly decreasing sequence of integers bounded below by 2. By the method of infinite descent (or the Well-Ordering Principle), such a sequence cannot be infinite; it must eventually reach a value where the strict decreasing condition x_k > 2 no longer holds.
Since the sequence is bounded below by , it must terminate at x_m = 2 for some finite index .
Finally, verifying the fixed point:
Thus, once the sequence reaches 2, it remains constant at 2 indefinitely.
Therefore , We can assign x \gets 2 when x \neq 1 and x=1 when x=1 (remains untouched) and then our problem is solved.
This forces exactly two of \{a,b,c\} to be and the other is not .
def solve():
a,b,c=map(int,input().split())
if([a,b,c].count(1)==2):
print("Yes")
else:
print("No")
for _ in range(int(input())):
solve()