# PRIMEDICE - Editorial

Author: Amaan Parvez
Testers: Takuki Kurokawa, Utkarsh Gupta
Editorialist: Nishank Suresh

643

None

# PROBLEM:

Alice rolls a die and gets A, while Bob gets B. Is their sum a prime?

# EXPLANATION:

The numbers rolled are between 1 and 6, so the sum can only be an integer between 2 and 12.

In this range, the prime numbers are 2, 3, 5, 7, 11. So, check if A+B is one of these prime numbers or not — the output is Alice if it is, Bob if it isn’t.

# TIME COMPLEXITY

\mathcal{O}(1) per test case.

# CODE:

Editorialist's code (Python)
for _ in range(int(input())):
a, b = map(int, input().split())
print('Alice' if a+b in [2, 3, 5, 7, 11] else 'Bob')