Hello guys, I am trying to solve 2018 Qualification Q3 and I think the logic is 
right and code seems right, but it gives wrong answer for second test case. 
Please check the code. Thanks in advance.

import sys

def solve(x, y , width):
    for _ in range(1000):
        if x > width:
            x = 2
        print(x,y)
        sys.stdout.flush()
        s = input()
        if s == "0 0":
            return True
        elif s == "-1 -1":
            exit()
        else:
            x += 3
    else:
        return False

for _ in range(int(input())):
    A = int(input())

    if (A % 9) ==0:
        width = A//9
    else:
        width = ((A//9)+1)

    width = 2 + ((width-1)*3)

    while True:
        if (solve(2,2,width)):
            break
        else:
            exit()

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/01777f46-6270-47d0-a1da-953d1ae421ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to