The Intended solution was i think uses Segment tree or similar binary data structure.
The takeaway from the problem was to learn how two lazy fields propagate down the tree during queries.
One lazy term was for the Multiplying a number to a node and then marking its children lazy(if they exist) and one lazy term was for resetting the node to a new sequence which was nothing but a factorial multiplied by a number and mark the children lazy for reset.
While propagating a reset update you can ignore the child’s previous lazy terms(both), convince yourself here. For propagating “multiplication” update if you encounter a node having reset lazy field then first reset the node from its reset lazy field, mark its child lazy for reset and then do a update query on this node.
For double-lazy propagation to work, in my opinion, there should be at least one reset update of some kind, because reset update tells us that we can ignore the child previous lazy terms and set them according to the new update, irrespective of the child node history, as it is a reset update. If you don’t have a reset update, then after some queries you will notice that some nodes contain both the lazy terms and you would not be able to distinguish which one to apply first and usually the order in which they are applied would matter and would yield different result, unless you suggest me some two different good operation whose order of application yields the same result(then that would make a good codechef long challenge problem :P)
A similar question that you can try is SEGSQRSS, although the test cases are very weak and you can get AC without lazy propagation, but then its just a waste of time. Do try that.