Problem C
Conundrum on the Roof
Languages
en
is
Input
The first line of the input contains two integers $d_ U, d_ N$ satisfying $0 \leq d_ U, d_ N \leq 10^9$. $d_ U$ is the maximum height Eyleifur will scale upwards in a single step and $d_ N$ is the maximum height Eyleifur is the maximum height Eyleifur will scale downwards in a single step. The next line contains two integers $r, c$ satisfying $1 \leq r, c \leq 10^5$. They will also satisfy $rc \leq 10^5$. Next the input will contain $r$ lines each containing $c$ integers $h_{i, j}$ satisfying $0 \leq h_{i,j} \leq 10^9$. The numbers $h_{i, j}$ give the height map Eyleifur made of the roof. $h_{1, 1}$ is always equal to $0$ and is where Eyleifur climbs up onto the roof and begins his walk towards the satellite dish. The last line of the input contains two integers $D_ i, D_ j$ satisfying $1 \leq D_ i \leq r$ and $1 \leq D_ j \leq c$ which give the location of the satellite dish.
Output
Print ‘Kvoldinu er bjargad!’ if Eyleifur can make it to the satellite dish and back to the ladder. If there is no way for Eyleifur to get to the satellite dish and back, print ‘Nu er Eyleifur i bobba!’.
Sample Input 1 | Sample Output 1 |
---|---|
1 2 3 3 0 2 6 1 3 5 2 3 4 3 3 |
Kvoldinu er bjargad! |
Sample Input 2 | Sample Output 2 |
---|---|
1 0 2 3 0 5 4 1 2 3 1 2 |
Nu er Eyleifur i bobba! |