Problem F. Fireworks

Author:A. Klenin   Time limit:1 sec
Input file:input.txt   Memory limit:256 Mb
Output file:output.txt  

Statement

You task is to display a firework in ASCII graphics. A firework consists of one or more explosions called breaks. Each break has an integer radius R and a level L and is displayed by '*' (ASCII 42) character at the center and 8 rays: 4 horizontal ('-', ASCII 45) and vertical ('|', ASCII 124) rays, each R + E characters long (where E is an additional parameter equal for all breaks); 4 diagonal ('/', ASCII 47 and '\', ASCII 92) rays, each R characters long. If the level of the break is greater then 1, at the end of each horizontal and vertical ray a new "child" break of radius R − 1 and level L − 1 is located. Child break has only 7 rays, because the ray in the direction leading to the "parent" break is not drawn. A firework starts from a single break. It must be output as a square of characters, having minimal size sufficient to display all the breaks. Characters not belonging to any break must be output as '.' (ASCII 46). Characters belonging to more than one break must be output as 'x' (ASCII 120).

Input file format

Input file contains integers L R E — level and radius of the initial break and the additional horizontal/vertical rays length.

Output file format

Output file must contain display of a firework.

Constraints

1 ≤ L ≤ R ≤ 10, 1 ≤ E ≤ 20

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
1 1 1
..|..
.\|/.
--*--
./|\.
..|..
2
2 4 1
..........|..........
.......\..|../.......
........\.|./........
.........\|/.........
......----*----......
........./|\.........
....|.\./.|.\./.|....
.\..|..x..|..x..|../.
..\.|./.\.|./.\.|./..
...\|/...\|/...\|/...
----*-----*-----*----
.../|\.../|\.../|\...
../.|.\./.|.\./.|.\..
./..|..x..|..x..|..\.
....|./.\.|./.\.|....
.........\|/.........
......----*----......
........./|\.........
......../.|.\........
......./..|..\.......
..........|..........

0.184s 0.092s 15