#P3655. 不成熟的梦想家 (未熟 DREAMER)
不成熟的梦想家 (未熟 DREAMER)
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
京公网安备 11011102002149号