Skip to content

Instantly share code, notes, and snippets.

@zsh-89
Created November 3, 2013 15:09
Show Gist options
  • Save zsh-89/7291216 to your computer and use it in GitHub Desktop.
Save zsh-89/7291216 to your computer and use it in GitHub Desktop.
int main()
{
int n, k;
scanf("%d %d", &n, &k);
n *= 2;
for (int i = 1; i <= n; i+=2) {
if (k) {
--k;
printf("%d %d ", i, i+1);
} else
printf("%d %d ", i+1, i);
}
return 0;
}
@eclipselu
Copy link

:lgtm:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment