시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB (추가 메모리 없음) | 218 | 80 | 69 | 46.939% |
You had a histogram made of $N$ axis-parallel rectangles sharing a common baseline: the $i$-th rectangle from the left had a width $1$ and an integer height $H_i$.
Sadly, you lost your histogram! Moreover, you even forgot what your histogram looked like — the heights of the rectangles of the histogram. What you remember is the maximum area $A$ of the axis-parallel rectangle inside the histogram, and the fact that $L\le H_i\le R$ for every $H_i$.
Your goal is to recover the histogram by finding any histogram satisfying all the requirements that you remember. As your memory might not be perfect, there may be no histogram satisfying the requirements.
The first and only line contains four space-separated integers, $N$, $A$, $L$, $R$.
If there is no histogram satisfying the requirements, output NO
.
Otherwise, output YES
in the first line. In the second line, output $N$ integers in a single line, where the $i$-th value is the height $H_i$ of the $i$-th rectangle. If there are multiple answers, print any.
6 25 2 10
YES 3 7 6 8 5 5
1 0 0 1000000000000000000
YES 0
1 8213912883 0 28318
NO
A histogram with heights $3,7,6,8,5,5$ is shown below. The maximum area rectangle inside the histogram has an area of $25$.