Art Academy

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Welcome to hewmatt10's Basement Art Academy!

Today, we will be learning how to draw mountains. You will draw N mountains, the i^{th} of which has a height of h_i.

Mountains are consisted only of ^, which are separated by spaces.

An example of a mountain would be:

 ^ ^
^ ^ ^

When drawing multiple mountains, you should separate them by a space.

 ^ ^   ^
^ ^ ^ ^ ^

In the example shown above, there is a mountain of h_i = 3 next to a mountain of h_i = 2.

Impress hewmatt10 with your artistic abilities!

Input Specification

The first line of input will contain N, the number of mountains to draw. The next line contains N space separated integers, h_1, \dots, h_N.

For all subtasks:

1 \le N \le 20

1 \le h_i \le 200

Batch 1 [10%]

N = 1

Batch 2 [90%]

No further constraints.

Output Specification

Output exactly \max(h_1, \dots, h_N) lines, following correct formatting. Trailing white spaces will be accepted.

Sample Input

3 2

Sample Output

 ^ ^   ^
^ ^ ^ ^ ^


There are no comments at the moment.