#P1157D. N Problems During K Days
N Problems During K Days
No submission language available for this problem.
Description
Polycarp has to solve exactly problems to improve his programming skill before an important programming competition. But this competition will be held very soon, most precisely, it will start in days. It means that Polycarp has exactly days for training!
Polycarp doesn't want to procrastinate, so he wants to solve at least one problem during each of days. He also doesn't want to overwork, so if he solves problems during some day, he should solve no more than problems during the next day. And, at last, he wants to improve his skill, so if he solves problems during some day, he should solve at least problem during the next day.
More formally: let be the array of numbers of problems solved by Polycarp. The -th element of this array is the number of problems Polycarp solves during the -th day of his training. Then the following conditions must be satisfied:
- sum of all for from to should be ;
- should be greater than zero for each from to ;
- the condition should be satisfied for each from to .
Your problem is to find any array of length satisfying the conditions above or say that it is impossible to do it.
The first line of the input contains two integers and () — the number of problems Polycarp wants to solve and the number of days Polycarp wants to train.
If it is impossible to find any array of length satisfying Polycarp's rules of training, print "NO" in the first line.
Otherwise print "YES" in the first line, then print integers in the second line, where should be the number of problems Polycarp should solve during the -th day. If there are multiple answers, you can print any.
Input
The first line of the input contains two integers and () — the number of problems Polycarp wants to solve and the number of days Polycarp wants to train.
Output
If it is impossible to find any array of length satisfying Polycarp's rules of training, print "NO" in the first line.
Otherwise print "YES" in the first line, then print integers in the second line, where should be the number of problems Polycarp should solve during the -th day. If there are multiple answers, you can print any.