newton/solutions/1551A.py

17 lines
327 B
Python
Raw Normal View History

2025-01-11 11:41:29 +00:00
t = int(input())
def check(c1,c2):
if c1+(2*c2) != n:
if (c1+1)+(2*c2) == n:
return c1+1,c2
elif c1+(2*(c2+1)) == n:
return c1,c2+1
else:
return c1,c2
for _ in range(t):
n = int(input())
c1,c2 = [n//3, n//3]
print(' '.join(str(x) for x in check(c1,c2)))