Art Academy

View as PDF

Submit solution

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

Author:
Problem type

Welcome to hewmatt10's Basement Art Academy!

Today, we will be learning how to draw mountains. You will draw N mountains, the ith of which has a height of hi.

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

An example of a mountain would be:

Copy
  ^
 ^ ^
^ ^ ^

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

Copy
  ^
 ^ ^   ^
^ ^ ^ ^ ^

In the example shown above, there is a mountain of hi=3 next to a mountain of hi=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 will contain N space separated integers, h1,,hN.

Constraints

For all subtasks:

1N20

1hi200

Subtask 1 [10%]

N=1

Subtask 2 [90%]

No additional constraints.

Output Specification

Output exactly max(h1,,hN) lines, following correct formatting. Trailing white spaces will be accepted.

Sample Input

Copy
2
3 2

Sample Output

Copy
  ^
 ^ ^   ^
^ ^ ^ ^ ^

Comments

There are no comments at the moment.