joj 2045: Mountains

2045: Mountains


ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE
1s8192K7937Standard

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:

  1. index begins with 1
  2. the index of a mountain with larger width is larger
  3. 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   

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值