luogu#P3655. 不成熟的梦想家 (未熟 DREAMER)
不成熟的梦想家 (未熟 DREAMER)
Background
What kind of future it is, nobody knows yet.
But it should be fun.
If we’re all together, we can overcome anything.
It’s just the beginning—let’s encourage each other.
What kind of future it is, nobody knows yet.
But I really hope it will be full of fun.
If we’re all together, we’ll even want to push our limits.
I want to grow—I’m still just an immature DREAMER.

The members of Aqours have finally gathered.
Today is our very first concert with everyone together.
Everyone has practiced well; I’m sure we’ll perform great.
However, everyone’s singing skills should be as close as possible. If someone is too outstanding or too far behind, it will affect the performance.
So we borrowed an invention from the neighboring Academy City that can change our members’ singing skills.
Problem Description
There are members in Aqours, lined up in a row.
Their singing skills are denoted by to , and all for are given.
The machine from Academy City can change the singing skills of a consecutive segment in the line by adding a number to each of them. Of course, if is negative, it means subtracting.
I plan to use this machine times. Each time, I add to the singing skills of all members from index to index (with ).
Our team’s charm value is computed as follows:
Initially, . Then, for members from index to :
- If : .
- If : .
Here and are constants given by the Love Live committee.
As the leader, I (Chika) am always at the front of the line, with singing skill always . The machine will never modify me. Thus at all times.
Can you help us compute the charm value after each use of the machine?
Input Format
- The first line contains four integers , , , (as described above).
- The next lines each contain one integer , with .
- The next lines each contain three integers , , (as described above).
Output Format
Output integers, one per line, where the -th line is the value of after the -th operation.
4 3 2 3
0
5
2
4
6
1 2 1
3 4 -3
1 4 2
-9
-1
-5
Hint
- For 30% of the testdata, .
- Additionally, for another 20% of the testdata, .
- For 100% of the testdata, ; ; .
- Note that a 64-bit integer may be required, and using std::cin/std::cout may time out.
Explanation of the sample:
After the first change,
A: 0 6 3 4 6
B: -12 -3 -5 -9
Easter egg:
None.
Why would there be so many easter eggs?
Translated by ChatGPT 5