To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker.
The premise of To The Moon is based around a technology that allows us to permanently reconstruct the memory on dying man. In this problem, we’ll give you a chance, to implement the logic behind the scene.
You‘ve been given integers . On these integers, you need to implement the following operations:
- : Adding a constant d for every , and increase the time stamp by , this is the only operation that will cause the time stamp increase.
- : Querying the current sum of .
- : Querying a history sum of in time .
- : Back to time . And once you decide return to a past, you can never be access to a forward edition anymore.
, , , . The system start from time , and the first modification is in time , , and won’t introduce you to a future state.
... (for each query, simply print the result. )