Problem D
Fancy Frames
You are a contractor of art for the ultra-rich.
Specifically, you are the primary middle-man for a very special
(but reclusive) painter. This painter can only be contacted via
the deep web, and can only design something that he’s seen
before. That means that while the patron may ask for a framed
painting of some sort, the painter will not be able to paint it
without seeing how it should look first.
Luckily, you happen to have background in coding. This means
that you can design a program that can allow the patron of the
artwork to put in a few specifications and develop it further
so the artist can make an actual painting out of it. Now, you
don’t have to make it perfect yet, as the painter can add more
modifications over time. For now, a patron will input some text
into your program, and it will create a small example of what
the artist has to make.
Input
The input is received as a single space-separated string on a single line. This string is of the form $a~ b~ c~ d$.
-
$a$: The art in text form. The art-piece is a string of length between 1 and 15 that can contain any alphanumeric character.
-
$b$: The material of the frame. This is any SINGLE valid symbol (string of length 1) on your keyboard.
-
$c$: The thickness of the frame. Determines the overall width of the frame. Is an integer such that $0 \leq c \leq 10$ for all inputs.
-
$d$: The gap between the art and the frame. Is an integer such that $0 \leq d \leq 20$ for all inputs. If the frame thickness is zero, the padding will also be zero.
Output
Will literally display the frame made of “material”
$b$ of thickness
$c$, with the separation
between the art-piece $a$
and the frame being $d$.
You should think about this in a very “what you see is what you
get” sort of way.
Sample Input 1 | Sample Output 1 |
---|---|
Painting1 @ 1 2 |
@@@@@@@@@@@@@@@ @ @ @ @ @ Painting1 @ @ @ @ @ @@@@@@@@@@@@@@@ |
Sample Input 2 | Sample Output 2 |
---|---|
Painting1 # 2 0 |
############# ############# ##Painting1## ############# ############# |
Sample Input 3 | Sample Output 3 |
---|---|
ZeroWidthFrame $ 0 0 |
ZeroWidthFrame |