#P7424. [THUPC 2017] 天天爱射击
[THUPC 2017] 天天爱射击
Problem Description
Xiao C has fallen in love with a game called “Daily Shooting”. As shown in the figure, there are some wooden boards parallel to the axis in this game. Now there are some bullets, which are shot in order along the axis direction toward these boards. After the -th board is penetrated by bullets, it will break and disappear. A bullet can penetrate all boards on its trajectory. In particular, if a bullet touches the edge of a board, it is also considered to have penetrated the board.
Xiao C now knows the positions of boards in the game, and also knows the shooting positions of bullets. You are asked: after each bullet is fired, how many boards will break?
Input Format
Read input from standard input.
The first line contains two integers and , representing the number of boards and the number of bullets. .
The next lines each contain three integers , representing the coordinate of the left endpoint, the coordinate of the right endpoint, and how many penetrations are needed for the board to break. It is guaranteed that and .
The next lines each contain one integer , representing the coordinate of each bullet. The bullets are given in firing order. It is guaranteed that .
Output Format
Write to standard output.
Output lines, each containing one integer, indicating how many boards break after each bullet is fired.
3 2
1 3 1
2 4 2
3 4 1
2
3
1
2
Hint

Copyright Information
From THUPC (THU Programming Contest, Tsinghua University Programming Contest) 2017.
:Thanks to
Translated by ChatGPT 5