• [F] Binary Numbers And Digits

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Recently, Hungar is studying binary numbers. But he faces a problem, he wants to know the Kth (K <= 10,000,000) binary numbers whose sum of all '1' digits is N (1 <= N <= 10).

  • 输入
  • There are several test cases.
    The first line, an integer T indicates the test cases.
    Next T lines, two integers K, N as mentioned above.
  • 输出
  • Output the Kth number in the binary number form.
  • 样例输入
  • 1
    7 3
    
  • 样例输出
  • 10110
    
  • 提示
  • 来源
  • Hungar
  • 操作

显示春菜