G. Coffin

2 sec, 256 M

There is a coffin sketch on a plank of size MxN. Could we put the coffin (after we saw it out) into a rectangular grave of size AxB? We could put the coffin into the grave when the coffin’s sides parallel to the grave ones only.

Input. The first line contains two numbers M, N (1 ≤ M, N ≤ 100). The next M contain N symbols each – ‘+’, if the cage is a part of the coffin and ‘.’ otherwise. The last line contains two numbers A and B (1 ≤ A, B ≤ 100).

Output. Print “Inhumation” without quotas if we can put the coffin into the grave. Print “Cremation” without quotas otherwise.

Input Output
3 3

.+.

++.

...

2 2

Inhumation
3 3

.+.

++.

...

3 1

Cremation

 

Idea – Alexander Sergeevich Antonenko

About the post author Igor Mazurok (5 Posts)

PhD in Computer Science, Associate professor of Department Applied Mathematics of Odessa I.I.Mechnikov National University, Ukraine KBIS Software Developer

Author Info

Igor Mazurok

PhD in Computer Science, Associate professor of Department Applied Mathematics of Odessa I.I.Mechnikov National University, Ukraine
KBIS Software Developer

Latest posts by Igor Mazurok (see all)

Leave a Reply