luogu#P8781. [蓝桥杯 2022 省 B] 修剪灌木
[蓝桥杯 2022 省 B] 修剪灌木
Problem Description
Alice needs to complete a job of trimming shrubs.
There are shrubs neatly arranged in a row from left to right. Every evening, Alice trims one shrub and makes its height become centimeters. The order in which Alice trims the shrubs starts from the leftmost shrub, trimming one shrub to the right each day. After trimming the rightmost shrub, she reverses direction and starts trimming shrubs to the left from the next day. After trimming the leftmost shrub, she reverses direction again. This repeats in a cycle.
Each shrub grows centimeter from morning to evening every day, and does not grow at other times. On the morning of the first day, the height of every shrub is centimeters. Alice wants to know the maximum height each shrub can grow to.
Input Format
A positive integer , with the meaning as described in the statement.
Output Format
Output lines, each with one integer. The -th line indicates the maximum height that the -th shrub from left to right can reach.
3
4
2
4
Hint
For of the testdata, .
For of the testdata, .
Lanqiao Cup 2022 provincial contest B group, problem D.
Translated by ChatGPT 5