Prime Calling Game
Time limit1sMemory limit512 MB
Two players take turns calling unused primes from their own ranges, and the player who cannot call one loses. Find the winner under optimal play.
- Level
Medium6 of 10
- Topics
- Game theory, Number theory, Math
- Solved
- No attempts yet
문제
Yongtae and Eugene want to play a prime-calling game. The game proceeds as follows.
- Yongtae chooses a range of primes . Yongtae may only call primes or greater and or less.
- Eugene chooses a range of primes . Eugene may only call primes or greater and or less.
- Starting with Yongtae, the two players take turns calling a prime within their own range. A prime must not have been called by anyone earlier in the game.
- The player who cannot call a prime any more loses.
Given the ranges for Yongtae and Eugene, who wins if both players play optimally?
입력
The first line contains integers (), the range of primes Yongtae may call.
The second line contains integers (), the range of primes Eugene may call.
출력
If both players play optimally and Yongtae wins, print yt. If Eugene wins, print yj.