Codeforces Round #473 (Div. 2), problem: (C) Mahmoud and Ehab and the wrong algorithm Solution In C/C++

#include<stdio.h>
int main(){
int n;
scanf(“%d”,&n);
if(n <= 5)
printf(“-1\n”);
else{
printf(“1 2\n2 3\n2 4\n”);
for(int i = 5;i <= n;i++)
printf(“1 %d\n”,i);
}
for(int i = 2;i <= n;i++)
printf(“1 %d\n”,i);
}

#include<stdio.h>
int main(){
int n;
scanf(“%d”,&n);
if(n <= 5)
printf(“-1\n”);
else{
printf(“1 2\n2 3\n2 4\n”);
for(int i = 5;i <= n;i++)
printf(“1 %d\n”,i);
}
for(int i = 2;i <= n;i++)
printf(“1 %d\n”,i);
}

More from author

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related posts

Advertismentspot_img

Latest posts

Everything You Need to Know About Viral Kitchen Gadgets Right Now

📢 As an Amazon Associate, I earn from qualifying purchases.There comes a point when you realise that tolerating a frustrating situation is costing you...

Liberal MP’s travel documents show claims he voted on bills while in China are false

Recent online claims accusing Canadian Member of Parliament Shaun Chen of violating parliamentary voting rules have been debunked following the release of travel records...

Why Viral Kitchen Gadgets Is Currently Breaking the Internet

📢 As an Amazon Associate, I earn from qualifying purchases.After putting the Viral Kitchen Gadgets through a proper 30-day real-world test, I can tell...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!