Back
Close

3D printer

Statement

 Goal

You get 3 pictures made by # in sizes width*height, length*height and width*length. The first one is the front view, the second one is the view from the right side and the third one is the view from the top. You need to print the 3D model based on the pictures you get; one by one layer separated by two dashes from bottom to the top layer and two dashes at the end.

Example Input
2    // width
5 // height
1 // length
## // start of front view, always height number of lines
##
##
##
##
# // start of right side view, always height number of lines
#
#
#
#
## // start of top view, always length number of lines

So from these inputs, your code should guess what is the 3D model. In the example it's a block 2x5x1.
Example Solution
##    // the lowest layer
--
##
--
##
--
##
--
## // the highest layer
--

If the three pictures cannot define some parts of the model as solid or hollow, assume these parts are solid, so that output '#' to fill-in.
Input
Line 1: An integer width of the 3D model
Line 2: An integer height of the 3D model
Line 3: An integer length of the 3D model
Next height lines: Strings - part of the front view
Next height lines: Strings - part of the view from the right
Next length lines: Strings - part of the view from the top

NOTE There is no trailing space in the input.
Output
Layers of the 3D model separated by two dashes and two dashes at the end.
Write no trailing space in output.
If the three pictures cannot define some parts of the model as solid or hollow, assume these parts are solid, so that output '#' to fill-in.
Constraints
0 < width, height, length ≤ 20
Example
Input
2
5
1
##
##
##
##
##
#
#
#
#
#
##
Output
##
--
##
--
##
--
##
--
##
--

Tags
StringsString manipulation3D

Difficulty
Medium

Test cases
example Test
Input
2 5 1 ## ## ## ## ## # # # # # ##
Output
## -- ## -- ## -- ## -- ## --

block Validator
Input
2 2 5 ## ## ##### ##### ## ## ## ## ##
Output
## ## ## ## ## -- ## ## ## ## ## --

weird shape Test
Input
5 5 2 ##### ## #### # ##### ## ## ## ## ## ##### #####
Output
##### ##### -- # # -- #### #### -- ## ## -- ##### ##### --

weird shape Validator
Input
5 5 1 ##### ### # ### ##### # # # # # #####
Output
##### -- ### -- # -- ### -- ##### --

WHAT THE... Test
Input
20 20 1 ##### ###### ######### ## ######## ############ #### #### ############### # ################# ####### ####### ########## # ################ ########### # ###### ######### # # # # # # # # # # # # # # # # # # # # ####################
Output
######### -- ###### -- # -- ########### -- ################ -- # -- ########## -- ####### -- ####### -- ################# -- # -- ############### -- #### -- #### -- ############ -- ######## -- ## -- ######### -- ###### -- ##### --

WHAT? Validator
Input
5 10 1 ##### # ##### # ##### ### ### ## #### ## # # # # # # # # # # #####
Output
## -- #### -- ## -- ### -- ### -- ##### -- # -- ##### -- # -- ##### --

Hole Test
Input
4 2 4 #### #### #### #### #### # # # # ####
Output
#### # # # # #### -- #### # # # # #### --

Hole Validator
Input
4 1 4 #### #### #### # ## # ## ###
Output
#### # ## # ## ### --

Cube with a hole Test
Input
6 6 6 ###### # # # # # # # # ###### ###### # # # # # # # # ###### ###### # # # # # # # # ######
Output
###### # # # # # # # # ###### -- # # # # -- # # # # -- # # # # -- # # # # -- ###### # # # # # # # # ###### --

Cube with a hole Validator
Input
4 4 4 #### # # # # #### #### # # # # #### #### # # # # ####
Output
#### # # # # #### -- # # # # -- # # # # -- #### # # # # #### --

A mug??? Test
Input
8 8 5 ##### ###### ####### ##### ## ##### ## ####### ###### ##### ##### ##### ##### ##### ##### ##### ##### ##### ### ##### ######## ##### ###
Output
### ##### ##### ##### ### -- ### ##### ###### ##### ### -- ### ##### ####### ##### ### -- ### ##### ##### ## ##### ### -- ### ##### ##### ## ##### ### -- ### ##### ####### ##### ### -- ### ##### ###### ##### ### -- ### ##### ##### ##### ### --

Another mug Validator
Input
7 8 5 ##### ##### ####### ##### # ##### # ####### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ### ##### ####### ##### ###
Output
### ##### ##### ##### ### -- ### ##### ##### ##### ### -- ### ##### ####### ##### ### -- ### ##### ##### # ##### ### -- ### ##### ##### # ##### ### -- ### ##### ####### ##### ### -- ### ##### ##### ##### ### -- ### ##### ##### ##### ### --

A chair Test
Input
8 13 8 ######## # # ######## # # ######## # # ######## # # # # # # # # # # # # # # # # # # ######## # # # # # # # # # # # # ######## ######## ######## ######## ######## ######## ######## ########
Output
# # # # -- # # # # -- # # # # -- # # # # -- # # # # -- # # # # -- ######## ######## ######## ######## ######## ######## ######## ######## -- # # -- ######## -- # # -- ######## -- # # -- ######## --

Another chair Validator
Input
8 13 8 ######## ######## ######## # # ######## ######## ######## # # # # # # # # # # # # # # # # # # ######## # # # # # # # # # # # # ######## ######## ######## ######## ######## ######## ######## ########
Output
# # # # -- # # # # -- # # # # -- # # # # -- # # # # -- # # # # -- ######## ######## ######## ######## ######## ######## ######## ######## -- ######## -- ######## -- # # -- ######## -- ######## -- ######## --

Solution language

Solution

Stub generator input