409200: GYM103456 C Red Light Green Light
Description
The first game to play is red light green light. Each player is allowed to move while there is a green light but most stop and stay in place while there is a red light. There are $$$N$$$ participants in the game and you know when exactly what times the light is going to change. Given this, you've been tasked with figuring out which participants will be able to reach the finish line before the light turns red forever (i.e. there are no more times at which the line changes).
The light starts at red and all players can accelerate and decelerate instantly.
InputThe first line has three integers, $$$M$$$, $$$N$$$, and $$$K$$$. $$$1 \leq M \leq 5000$$$ is the number of light changes, $$$1 \leq N \leq 5000$$$ is the number of participants, and $$$1 \leq K \leq 10000$$$ is the distance the end is from the start in meters.
The next line contains $$$M$$$ integers $$$1 \leq t_i \leq 5000$$$, when the changes happen from red to green (or vice-versa) in seconds since the beginning. ($$$M$$$ will be an even number so that at the end the light will be red)
The next line contains $$$N$$$ integers, the speed of a participant $$$1 \leq p_i \leq 10$$$ in meters per second.
OutputThe output should be one line with $$$N$$$ space-separated integers. The $$$i$$$th integer should be $$$0$$$ if the $$$i$$$th competitor will lose and $$$1$$$ if the $$$i$$$th competitor will win.
ExamplesInput4 3 10 4 2 7 5 4 2 3Output
1 0 1Input
2 1 1000 1 500 2Output
0