PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000148. Trò chơi tổng nguyên tố (Prime Sum Game)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Trò chơi tổng nguyên tố (Prime Sum Game)
Prime Sum Game
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Takahashi first chooses , then Aoki chooses after seeing . Aoki wins if is prime; otherwise Takahashi wins. Both play optimally. Print the winner.
Input
One line containing .
Output
Print Takahashi or Aoki.
Subtask
- Subtask 1 (20 points): and .
- Subtask 2 (30 points): and .
- Subtask 3 (50 points): and .
Example
Input
2 3 3 4
Output
Aoki
Explanation
For Takahashi choice 2, Aoki answers 3, making 5. For Takahashi choice 3, Aoki answers 4, making 7. Both sums are prime.