chef & interective

“Every beginning has an end… and an editorial.” - taran_1407

What the hell are all these interactive problems? What does flushing output mean? So many questions… Chef explains it in an easy way: you must communicate with a grader program, which accepts your input only if you flushed the output.

There is a contest with interactive problems where N people participate. Each contestant has a known rating. Chef wants to know which contestants will not forget to flush the output in interactive problems. Fortunately, he knows that contestants with rating at least r never forget to flush their output and contestants with rating smaller than r always forget to do it. Help Chef!

Input
The first line of the input contains two space-separated integers N and r.
Each of the following N lines contains a single integer R denoting the rating of one contestant.
Output
For each contestant, print a single line containing the string “Good boi” if this contestant does not forget to flush the output or “Bad boi” otherwise.

Constraints
1≤N≤1,000
1,300≤r,R≤1,501
Subtasks
Subtask #1 (100 points): original constraints

Example Input
2 1500
1499
1501

My program -

#include<stdio.h>
int main()
{
int t,r,i;
float a,b;
scanf("%d",&t);
scanf("%d",&r);
if(t<=1000 || t>=1)
{
if(r<=1501 || r>=1300)
{
for(i=0;i<t;i++)
{
scanf("%f",&a);
scanf("%f",&b);
if(a<r)
{
printf(“Bad boi”);
printf("\n");
}
else if(a>=r)
{
printf(“Good boi”);
printf("\n");
}
if(b<r)
{
printf(“Bad boi”);
printf("\n");
}
else if(b>=r)
{
printf(“Good boi”);
printf("\n");
}
}
}
}
return 0;
}

  • what i have to do to pass it ?

Don’t post your codes. I see you are having a tough time with interactive problems. I suggest you to read about interactive problem in this good post written by @taran_1407:

https://discuss.codechef.com/questions/141708/interactive-problems-and-the-way-to-deal-with-them

Don’t post codes related to on going contest