#SDNU1648. Min. Min? Min!
Min. Min? Min!
Description
You have integers and an integer indicating the operation times. You need to deal with two kinds of operations.
Operation 1:1 p x, do transformation .
Operation 2:2 p x, do transformation .
You only need to output the array after operations.
Format
Input
The first line of input is an integer , an integer , an integer and an integer .
In order to avoid too much input data, the following methods are used to generate data
Output
In order to avoid too much output data, you only need to output the of the array after times operations .
Samples
5 5 5135616135616484 8646484451351
462653860
Hints
Initialy, aray a is $[527131783415709210,246057301899044788,873328851580452745,322412099270849533,750787086394534891]$ The first operation is ,the array a transforms to $[527131783415709210,246057301899044788,249065584865898997,249065584865898997,249065584865898997]$ The second operation is , the array a transforms to $[527131783415709210,246057301899044788,249065584865898997,249065584865898997,249065584865898997]$ The third operation is ,the array a transforms to $[527131783415709210,246057301899044788,249065584865898997,249065584865898997,249065584865898997]$ The forth operation is , the array a transforms to $[182083963193278158,246057301899044788,249065584865898997,249065584865898997,249065584865898997]$ The fifth operation is ,the array a transforms to $[182083963193278158,246057301899044788,249065584865898997,249065584865898997,249065584865898997]$ So the sum of the array a after m times operations is $(182083963193278158+246057301899044788+249065584865898997+24906584865898997+249065584865898997)%10000007=462653860$