# Storage box

0.55 Professor Oak has a storage box of size $h \times w \times \ell$
(hight, width and length) in his garden. Although he is currently
storing some soil and fertilizer in it, he secretly plans to use it to
hide the ashes of the corpses of the students that he will catch
cheating in the future. He already has a large number of small boxes for
the ashes, all of size $3 \times 2 \times 1$. Note that each small box
can be considered as the union of six $1 \times 1 \times 1$ cubes.

Given $h$, $w$ and $\ell$, can you tell if it is possible to completely
fill the storage box with small boxes? We can arrange each small box
inside the storage box in any direction parallel to the three
dimensional axes.

Moreover, if it is possible to fill the storage box, can you provide a
way?

0.40 ![image](bagul.eps){width="5.6cm"}

![image](caixeta.svg){width="5cm"}

## Input

Input consists of several cases, each with $h$, $w$ and $\ell$, all
natural numbers. You can assume $1 \le h \times w \times \ell \le 10^5$.

## Output

For each case, if it is impossible to fill the storage box, just print
"`NO`". Otherwise, print "`YES`" and $h \cdot (w + 1)$ lines as follows:
Assign a different number between 1 and $10^5$ to each small box, and
print it exactly six times to describe the positions of the six
$1 \times 1 \times 1$ cubes of the box. Each of the $h$ levels of the
storage box must be described with $w$ lines, each with $\ell$ numbers.
An additional line with 10 dashes ends each level. If there is more than
one solution, you can print any one. Follow strictly the format of the
sample output.

For instance, to the left of the fifth sample output for a box with
heigth 3, width 2 and length 4 you can see a picture of the given
solution.

![image](exemple.svg){width="12cm"}

## Problem information

Author: Salvador Roura\
Event: Vint-i-quatrè Concurs de Programació de la UPC - Semifinal\
Date: 2026-06-18

Generation: 2026-06-10T18:39:54.658Z

© *Jutge.org*, 2006--2026.\
<https://jutge.org>
