https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/07/Codeforces-Round-423-Div-2-rated-based-on-VK-Cup-Finals-problem-D-High-Load-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals), problem: (D) High Load Solution In C/C++

#include <cstdio>
int main(){
int n, k;
scanf(“%d%d”, &n, &k);
int l = (n – 2) / k + 1;
printf(“%d\n”, 2 * l – ((n – 1) % k == 1));
for(int i = 2; i <= n; i++)
printf(“%d %d\n”, i, i <= k + 1 ? 1 : i – k);
return 0;
}

(Visited 11 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: