Header Ads Widget

Goki and his breakup

Problem:-

Goki recently had a breakup, so he wants to have some more friends in his life. Goki has N people who he can be friends with, so he decides to choose among them according to their skills set Yi(1<=i<=n). He wants atleast skills in his friends.
Help Goki find his friends.

 INPUT
First line of the input contains an integer N denoting the number of people.
Next line contains a single integer X - denoting the minimum skill required to be Goki's friend.
Next n lines contain one integer Y - denoting the skill of ith person.

OUTPUT
For each person print if he can be friend with Goki. 'YES' (without quotes) if he can be friends with Goki else 'NO' (without quotes).

CONSTRAINTS
1<=N<=1000000
1<=X,Y<=1000000
SAMPLE INPUT
 
5
100
110
130
90
100
45
SAMPLE OUTPUT
 
YES
YES
NO
YES
NO
Explanation
X is 100, so the first query is 110, so as 110 is greater than 100 answer is YES.
Time Limit:1.0 sec(s) for each input file.
Memory Limit:256 MB
Source Limit:1024 KB

solution:-

#include<stdio.h>
void main()
{
int n,i,n1,m;
scanf("%d",&n);
scanf("%d",&m);
for(i=1;i<=n;i++)
{
scanf("%d",&n1);
if(n1>=m)
printf("YES\n");
else
printf("NO\n");
}
}

Post a Comment

0 Comments