#C5827. Kids with Candies

    ID: 49519 Type: Default 1000ms 256MiB

Kids with Candies

Kids with Candies

You are given nn children, where the ii-th child has a certain number of candies represented by an integer. Additionally, you are given an integer EE 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 ii-th child is denoted as aia_i, and M=max(a1,a2,,an)M=\max(a_1, a_2, \ldots, a_n), then output True for that child if and only if ai+EMa_i+E \ge M, 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 nn and EE separated by space, where nn is the number of children and EE is the number of extra candies available. The second line contains nn space-separated integers a1,a2,,ana_1, a_2, \ldots, a_n, where aia_i represents the number of candies the ii-th child has.

outputFormat

Output a single line containing nn boolean values (either True or False) separated by a space. The ii-th boolean value should be True if after adding the extra candies the ii-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>