CF359B.Permutation

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A permutation pp is an ordered group of numbers p1,p2,...,pnp_{1},p_{2},...,p_{n} , consisting of nn distinct positive integers, each is no more than nn . We'll define number nn as the length of permutation p1,p2,...,pnp_{1},p_{2},...,p_{n} .

Simon has a positive integer nn and a non-negative integer kk , such that 2k<=n2k<=n . Help him find permutation aa of length 2n2n , such that it meets this equation: .

输入格式

The first line contains two integers nn and kk ( 1<=n<=500001<=n<=50000 , 0<=2k<=n0<=2k<=n ).

输出格式

Print 2n2n integers a1,a2,...,a2na_{1},a_{2},...,a_{2n} — the required permutation aa . It is guaranteed that the solution exists. If there are multiple solutions, you can print any of them.

输入输出样例

  • 输入#1

    1 0
    

    输出#1

    1 2
  • 输入#2

    2 1
    

    输出#2

    3 2 1 4
    
  • 输入#3

    4 0
    

    输出#3

    2 7 4 6 1 3 5 8
    

说明/提示

Record x|x| represents the absolute value of number xx .

In the first sample 1212=0|1-2|-|1-2|=0 .

In the second sample 32+1432+14=1+32=2|3-2|+|1-4|-|3-2+1-4|=1+3-2=2 .

In the third sample 27+46+13+5827+46+13+58=1212=0|2-7|+|4-6|+|1-3|+|5-8|-|2-7+4-6+1-3+5-8|=12-12=0 .

首页