Histogram Sequence 4
시간 제한1초메모리 제한1024 MB
N, A, L, R이 주어질 때 높이가 [L,R] 범위에 있고 내부 최대 직사각형 넓이가 정확히 A인 히스토그램을 만든다.
문제
You had a histogram made of axis-parallel rectangles sharing a common baseline: the -th rectangle from the left had a width and an integer height .
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 of the axis-parallel rectangle inside the histogram, and the fact that for every .
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, , , , .
출력
If there is no histogram satisfying the requirements, output NO.
Otherwise, output YES in the first line. In the second line, output integers in a single line, where the -th value is the height of the -th rectangle. If there are multiple answers, print any.
제한
힌트
A histogram with heights is shown below. The maximum area rectangle inside the histogram has an area of .
