Example Input 6 2 3 1 1 4 2 Output Yes Yes Yes No Yes No
- User
Example Input
6 2 3 1 1 4 2
Output
Yes Yes Yes No Yes No
Assistant
import math def is_hypotenuse(x): if x < 5: return False n = x for i in range(2, int(math.isqrt(n)) + 1): if i > n: break if n % i == 0: if i % 4 == 1: return True while n % i == 0: n //= i if n > 1 and n % 4 == 1: return True return False def is_leg(x): if x == 1: return False x_squared = x * x max_d1 = int(math.isqrt(x_squared)) for d1 in range(1, max_d1 + 1): if x_squared % d1 == 0: d2 = x_squared // d1 if d1 >= d2: continue if (d1 % 2) == (d2 % 2): return True return False n = int(input()) for _ in range(n): x = int(input()) if is_hypotenuse(x) or is_leg(x): print("Yes") else: print("No")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.