409200: GYM103456 C Red Light Green Light

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Red Light Green Lighttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

The 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.

Output

The 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.

ExamplesInput
4 3 10
4 2 7 5
4 2 3
Output
1 0 1 
Input
2 1 1000
1 500
2
Output
0 

加入题单

算法标签: