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
def is_possible(n): # Check if n can be a leg target = n * n # Iterate possible divisors d1 of target for d1 in range(1, int(target**0.5) + 1): if target % d1 == 0: d2 = target // d1 if (d1 + d2) % 2 == 0 and (d2 - d1) % 2 == 0: m = (d2 - d1) // 2 if m > 0: return True # Check if n can be a hypotenuse max_a = int((n**2 // 2) ** 0.5) for a in range(1, max_a + 1): b_sq = n*n - a*a if b_sq < 1: continue b = int(b_sq ** 0.5) if b * b == b_sq: return True return False t = int(input()) for _ in range(t): n = int(input()) print("Yes" if is_possible(n) else "No")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.