2045: Mountains
Result | TIME Limit | MEMORY Limit | Run Times | AC Times | JUDGE |
---|---|---|---|---|---|
![]() | 1s | 8192K | 79 | 37 | Standard |
A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '/'. We call upwards and downwards together as wards. Let /n be an upward of length n, and in the same way, let /n be a downward of length n. For example, the following upward is /2:
/ /
and the following downward is /3:
/ / /
The set of all hills is given in the following:
Hills =def { /n/n | n is a natural number }
Now it comes to the definition of a mountain(in BNF):
Mountain ::= Hill | Mountain Mountain
That's to say, a hill is a mountain, and if M and N are mountains, then the concatenation of M and N is also a mountain.
For example,
// / /
is a mountain with 3 hills.
We define the width of a mountain as the number of upwards and downwards. We define the height of a mountain as the maximum length of upwards(or equivalently downwards).
We can give each mountain a unique number, called index, such that the following conditions are met:
- index begins with 1
- the index of a mountain with larger width is larger
- if two mountains have the same width, then the index of the mountain whose leftmost different ward with the other mountain is an upward is larger
For example, portion of the mountains and their indices are:
// // // // // / / // /// / ... / / /// /// ... 1 2 3 4 5 9 10
In this problem, you are print the mountain from the given index.
Input
The input contains several lines, each of which contains an integer N<2^32. The last line contains 0, which you should not proceed.
Output
For each N, your program should print the mountain. For simplicity, you needn't make the mountain climbing. You can imagine that the mountain finally printed is the one after being flattened. For example, for N=9, your program should simply print:
.
Each mountain should be printed in a single line.
Sample Input
6 9 0
Sample Output
//
Problem Source: siyee
This problem is used for contest: 9 171