Unable to pass all the Test cases

I was trying to solve the following problem using dfs approach but unable to pass all the test cases.


The approach i used to solve it is that i made a chk function which checks for whether the pair (x,y) can be a part of path(as it will be a part of the path if it doesnt lie under any circle).Then i applied dfs from (0,0) to (A,B) and after that i checked whether we are able to visit A,B or not.
I only considered the paths where x and y are increasing because A and B are positive so it is not required to consider the decrement in x and y.
Please debug the code and tell where the problem is

Test case at which it fails:-
A : 10
B : 99
C : 8
D : 2
E : [ 5, 2, 4, 6, 4, 3, 8, 1 ]
F : [ 47, 32, 35, 8, 64, 97, 43, 49 ]
Ans should be yes and it is giving no

@TusHar-AroRa-2294450460870717 go in all 8 directions!
you may also refer my code (ONLY AFTER YOU TRIED YOUR BEST)

Now its working after taking 8 directions but can u tell me why we have to take all 8 directions as A and B are always positive which means they are in first quadrant so why we have to consider negatives changes in x and y as only positive changes are required to reach till A and B.
Please explain this point.
Thank you

Think of a zig zag path