Toggle navigation
YouTube
Facebook
Telegram
english
english
українська
Algotester 4.3
Build 496
2024-10-17
Log In
Contact Us
College
Sponsors
Donate
Sources
Python 3
t = int(input()) for _ in range(t): n, m = map(int, input().split()) print(2+max(n, m)%2 if min(n, m) == 1 else 0)