DOJO - With a Pit of Death
Leo is training his martial arts in byteland's dojo.
The dojo is a rectangular ( n × m ) area with a pit of death, a square located at (i, j), where 1 <= i <= n, and 1 <= j <= m.
Every night, battles are very hard and the dojo is destructed, and reconstructed during the day around the pit.
Every evening, Leo's first mission is to make in place tatamis ( 2 × 1 ) in the new dojo.
Tatamis should cover the whole dojo except the pit of death.
Sometimes it's possible, sometimes not!
The input begins with the number T of test cases in a single line.
In each of the next T lines there are four integers n, m, i and j.
For each test case, print the answer of the problem : "Possible." or "Impossible.".
3 3 2 2
3 3 1 2
1 <= T <= 1 000
1 <= i <= n <= 32
1 <= j <= m <= 102000
Edit 2017-02-11 : 0.15s as TL, alongside the compiler changes.
I submitted the same solution numerous times , it got ac two times and exceeded the time limit in the rest. How is this possible ?
those full stops cost me 2 hours of debugging :/ .. AC finally :D
(Tjandra Satria Gunawan)(æ›¾æ¯…æ˜†):
@Francky: I hope you make BF solvable problem again :-) This is your first and easiest problem isn't it?
Thanks. And it uses less memory than those Java submissions too! :p
Congratulations to Mitch, the first solver with uncommon language, and faster than others.