Problem J
Jumper
Languages
da
en
is

You lost your favourite jumper during last night’s pub crawl
with your fifteen friends. You remember very little, but thanks
to some selfies on your phone you have been able to identify a
pub
Your group of friends always visits the pubs in the same
order, but you have never paid any attention to this—you just
tend to keep up with the group. Unlike you, all your friends
know the pub crawl order by heart. To avoid appearing too
absent-minded, you will ask them each of them a question of the
form “What is the name of the pub that we always visit
The town has
Interaction
This is an interactive problem. Your submission will be run
against an interactor program, which reads the
standard output of your submission and writes to the standard
input of your submission. The interactor begins by writing a
single integer
For each test case, the pub crawl permutation
Read | Sample Interaction 1 | Write |
---|
4
? 10 4
8
? 54 9
4
? 54 8
42
! 42