P14574 Fakers

Background

![](https://s21.ax1x.com/2025/07/10/pVQW1BQ.png) Cynthia hates people who make the fake information, but the computer room is full of Fakers, which makes her very angry.

Description

There are $n$ people in the computer room. Today, they held a practice competition with a total of $m$ problems. Cynthia recorded $k$ events that occurred after the practice contest. The $i$-th event is represented by a triple $(x_i,y_i,v_i)$, meaning that person numbered $x_i$ told Cynthia that their score on problem $y_i$ was $v_i$. If someone does not tell Cynthia their score on a problem, they are considered to have scored $0$ on that problem. However, the computer room is full of Fakers. If someone **tells** Cynthia that their score on a problem is $v$, Cynthia will believe they actually scored $100$ if $v \leq l$; $0$ if $v \geq r$; and $v$ otherwise. You need to help Cynthia calculate everyone's score in her mind.

Input Format

Enter five positive integers in the first line, $n,m,k,l,r$, as described in the question. The next $k$ lines contain three integers $x_i,y_i,v_i$, as described in the question.

Output Format

Output a total of $n$ integers in one line, representing the score of each person in Cynthia's mind.

Explanation/Hint

### Sample Explanation Person 1 scored $85$ and $48$ for the two problems, respectively. Since $85 \geq 65,38 < 48 < 65$, in Cynthia's mind, person 1's score is $0 + 48 = 48$. Person 2 scored $32$ and $38$ for the two problems, respectively. Since $32 \leq 38$, and since they did not tell Cynthia their score for the second problem, in Cynthia's mind, person 2's score is $100 + 0 = 100$. ### Data range |Subtask|$n,m \leq$|Score| |:-:|:-:|:-:| |Subtask 1|$3$|$30$| |Subtask 2|$100$|$30$| |Subtask 3|$500$|$40$| For $100\%$ of the data, it is guaranteed to meet the following conditions: - $1 \leq k \leq nm$. - $1 \leq l < r \leq 100$. - $\forall 1 \leq i \leq k,0 \leq v_i \leq 100$. - $\forall 1 \leq i < j \leq k,(x_i,y_i) \neq (x_j,y_j)$.