Advertisement
AlimusSifar

Alice and the Chessboard - Toph.co - Brute Force | Python

Apr 24th, 2020
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # Python 3.7
  2. #   1 2 3 4 5 6 7 8
  3. # 1 . o . . . . . .
  4. # 2 . . o . . . . .
  5. # 3 . . . o . . . o
  6. # 4 . . . . o . o .
  7. # 5 . . . . . X . . X -> bishop position
  8. # 6 . . . . o . o . o -> available positions
  9. # 7 . . . o . . . o
  10. # 8 . . o . . . . .
  11.  
  12. T = int(input())
  13. for t in range(T):
  14.     iRow, iCol, fRow, fCol = map(int, input().split())
  15.     if abs(iRow-fRow) == abs(iCol-fCol):
  16.         print('Yes')
  17.     else:
  18.         print('No')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement