HDU National Treasures
The great hall of the has been few times 。 is now about the of the on 。 To help the hall, the with a to to stay in the great hall and keep an eye on the 。 The would like to hire the of so that the great hall is 。 The great hall is as a two grid of R × C cells。 Some cells are with the ’s 。
All cells are by of types (, , 。 。 。 etc。) which can be by new hired 。 For each , few other cells in the hall are as of the on the value, type of vault it is kept , and few other 。 In other words, if this is going to stay in the hall then all of its must have on them。 A guard in a of can keep an eye on them all。
A guard, , can not stand in a cell which an (, you may the to allow the guard to stay there)。 Also you can not an and leave the space free (you can only an with a new hired guard)。 all the in the great hall you out that the of any ( by a
) are a of the 12 cells as shown in the grid below.
, the type of an can be as a non- where the i-th bit is 1 only if point i from the above is a point of that . For an of type 595 (in ) can be as shown in the below. Note that bits are from right to left (the right-most bit is bit 1.) If a point of an lies the hall grid then it is .
You are given the of the great hall and are asked to find the of to hire such that all are .