Professional Documents
Culture Documents
The famous adventurer known only as Digger has learnt of this mountain and its
treasure, and of course he wants to get to it. Fortunately, he isn't called Digger for
nothing - he possesses a special machine which can remove all the rock from a metre by
metre square (he refuses to tell us where this rock ends up), with the incredible fuel
consumption of 1 million gallons per such an operation. Digger can walk freely around
any open space, both natural and artificial, but since he's restricted to the ground, the
height of the caves doesn't matter. Though Digger is pretty rich, he still wishes to
minimize the amount of fuel he uses to reach the treasure.
Digger can start anywhere on the outside of the mountain. Determine the minimum
amount of fuel he must use to reach the treasure.
Input
A, B, and N respectively, the length of the West and North sides of the
Line 1: mountain (in metres) and the number of caves.
Y1, X1, Y2 and X2 the i-th line gives the location of the (i-1)-th cave,
Lines 2..N+1: where Y1 and Y2 (Y1 Y2) are the distances of the sides of the cave
from the North side of the mountain (in metres),
and X1 and X2 (X1 X2) are the distances from the West side. No two
caves will overlap or touch at a corner or side, and all caves will be
completely inside the mountain.
Lines N+2: Y and X the location of the treasure (Y metres from the North side of
the mountain, and X metres from the West side). The treasure will lie
within one of the caves.
Output
A single number - the minimum amount of fuel Digger must use to reach the treasure (in
millions of gallons).
Sample Input
11 12 3
1 2 1 4
3 5 3 5
5 5 5 6
5 6
Explanation
A bird's-eye-view cross-section of the cave would look like this ('x': solid rock, '.': cave,
'T': treasure):
0 2 4 etc
0 xxxxxxxxxxxx
xx...xxxxxxx
2 xxxxxxxxxxxx
xxxxx.xxxxxx
4 xxxxxxxxxxxx
xxxxx.Txxxxx
e xxxxxxxxxxxx
t xxxxxxxxxxxx
c xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
Sample Output
4
Explanation
Digger starts by tunnelling to the 1st cave from the North edge of the mountain - this
requires 1 million gallons of fuel. He then goes to the 2nd cave, using another 2 million
gallons. Finally, he digs down to the 3rd cave, using 1 million gallons of fuel, and then
walks to the East to claim the treasure. This is a total of 4 million gallons (1+2+1). One
possible set of digging sites is shown below ('D': dig here):
xxDxxxxxxxxx
xx...xxxxxxx
xxxxDDxxxxxx
xxxxx.xxxxxx
xxxxxDxxxxxx
xxxxx.Txxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
To take care of this threat for good, the masked billionaire will have to elaborate a plan
like no other he's ever concocted. In particular, Batman plans to use Kryptonite-based
weapons and a heavily-armored mech suit to defeat the most powerful being on Earth.
The success of the battle is hugely dependent on the strength/purity of the Kryptonite
weapons as well as the durability of the mech suit. He has aggregated the attack power
provided by his weapons and the defense power provided by his suit into two
ratings AB and DB respectively. Being a master detective, Batman has also carefully
scrutinized Superman's strength and techniques from past battles. Through this, he has
aggregated Superman's attack power and defense power into two
ratings AS and DSrespectively. Each of these four ratings is a positive integer no greater
than 100.
Clearly, Batman will emerge victoriously if his attack power is strictly greater than
Superman's defense power, and his defense power is strictly greater than Superman's
attack power. On the other hand, Superman will prevail if his attack power is strictly
greater than Batman's defense, and his defense is also strictly greater than Batman's
attack. If neither of these situations occur, then unfortunately it will be unclear who will
win, so the outcome will be difficult to predict.
Batman is the type of hero who needs contingency plans for his contingency plans, so
there's no way he'll be willing to enter the fight with surprises. Can you help him predict
the results of the upcoming battle or determine that it's inconclusive so Batman knows he
must further prepare?
Input Format
The first line will contain the two space-separated integers AB and DB.
The second line will contain the two space-separated integers AS and DS.
Output Format
Output on a single line the result of the showdown Batman if Batman will
win, Superman if Superman will win, or Inconclusiveotherwise.
Sample Input 1
12 31
100 60
Sample Output 1
Superman
Sample Input 2
1 4
2 3
Sample Output 2
Inconclusive
Sample Input 3
50 51
50 50
Sample Output 3
Inconclusive