#C5827. Kids with Candies
Kids with Candies
Kids with Candies
You are given children, where the -th child has a certain number of candies represented by an integer. Additionally, you are given an integer denoting the extra candies available. For each child, determine whether adding the extra candies to that child's current candies will allow them to have at least as many candies as any other child. Formally, if the candies of the -th child is denoted as , and , then output True
for that child if and only if , otherwise output False
.
This problem tests your ability to manipulate arrays and perform basic comparisons. Make sure your solution reads from stdin
and writes the answer to stdout
.
inputFormat
The first line of input contains two integers and separated by space, where is the number of children and is the number of extra candies available. The second line contains space-separated integers , where represents the number of candies the -th child has.
outputFormat
Output a single line containing boolean values (either True
or False
) separated by a space. The -th boolean value should be True
if after adding the extra candies the -th child can have a candy count not less than any other child; otherwise, False
.## sample
5 3
2 3 5 1 3
True True True False True
</p>