Help me in solving AVOIDWALK problem

My issue

“It is allowed to move to a cell that previously contained a goose — of course, as long as you only move one step right or down.”
How does above statement affect the problem?

My code

test_cases = int(input())
for _ in range(test_cases):
    params = input().split()
    params = list(map(int, params))
    a, b = params

Problem Link: Go Away, Goose! Practice Coding Problem - CodeChef