## MMINPER - Minimum Permutation

no tags

Đọc đề đẹp hơn ở:
https://codeforces.com/group/FLVn1Sc504/contest/274506/problem/T
 English Vietnamese
```Số nghịch thế của dãy a1, a2, .., an là số cặp (ai, aj) mà i < j và ai > aj .
Cho n và số nghịch thế m, tìm hoán vị nhỏ nhất của tập
{ 1, 2, . . . , n } , mà số nghịch thế là m.
Hoán vị a1, a2, . . . , an nhỏ hơn hoán vị b1, b2, . . . , bn nếu tồn tại số nguyên
k sao cho aj = bj với 1 ≤ j < k và ak < bk.
```

### Input

```Gồm một số test case, mỗi test gồm 2 số nguyên n và m và kết thúc là 2 số -1 -1.
Giả thiết 1 ≤ n ≤ 50000 và 0 ≤ m ≤ 1/2n(n − 1).

Sample Input
5 9
7 3
-1 -1
```

### Output

```
Với mỗi test, in ra hoán vị nhỏ nhất trên 1 dòng.

Sample output
4 5 3 2 1
1 2 3 4 7 6 5
```

 Added by: ~!(*(@*!@^& Date: 2009-02-23 Time limit: 1s Source limit: 50000B Memory limit: 1536MB Cluster: Cube (Intel G860) Languages: All except: ERL JS-RHINO NODEJS PERL6 VB.NET Resource: Pre Shanghai 2004