Binary Number
题号:NC218174
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

A n bit binary number, the quantity of '1' is in [u, v], determine the k-th greatest binary number.

输入描述:

One line with 4 integer n, u, vand kseparated by spaces. 

输出描述:

The k-th greatest number.
示例1

输入

复制
8 4 6 24

输出

复制
11100010

说明

11100010 has four '1's.
The 1-st - 24-th numbers are

11111100            11111010               11111001            11111000               11110110            11110101               11110100            11110011               11110010            11110001               11110000            11101110

11101101            11101100               11101011            11101010               11101001            11101000                11100111            11100110               11100101            11100100               11100011            11100010

备注:

1 <= u <= v <= n <= 50