Asteroids
Difficulty : Easy
Community success rate: 62%
Approved by codybumba AgathokakologicalBit tuna_in_cream
A higher resolution is required to access the IDE
- 1284
Statement
Goal
You have been tasked with studying a region of space to detect potentially dangerous asteroids.You are given two pictures of the night sky of dimensions
For your convenience, asteroids have been marked with capital letters
Using the information contained in those two pictures, determine the position of the asteroids at
If necessary, the final coordinates are to be rounded-down (floor).
Asteroids travel at different altitudes (with
If two or more asteroids have the same final coordinates, output only the closest one.
It is guaranteed that all asteroids at
NB: Because of the flooring operation, it is important that you choose a coordinate system with the origin at the top left corner and the y axis increasing in the downward direction.
Input
Line 1: five ints separated by a space, W H t1 t2 t3
Next H lines: a row of picture 1 and picture 2, separated by a white space.
Next H lines: a row of picture 1 and picture 2, separated by a white space.
Output
Constraints
0<W <=H <=20
0<=t1 <t2 <=t3 <=10000
0<=
Example
Input
5 5 1 2 3 A.... .A... ..... ..... ..... ..... ..... ..... ..... .....
Output
..A.. ..... ..... ..... .....
A higher resolution is required to access the IDE