Gyrating Glyphs

아직 제출이 없습니다시간 제한6초메모리 제한1024 MB

문제

You are rocking the latest breakthrough in Computer Science: animated fonts. Suddenly, all of your colleagues' code looks amazing, and you are finally motivated to review it. Unfortunately, due to the constant rotations, it is hard to distinguish between the ++ (plus) and the ×\times (multiply) operators (all the other characters are still readable). The function you are reviewing takes as input n+1n+1 integers a_0,a_1,,a_na\_0, a\_1, \ldots, a\_n and returns the value ((((a_0,op_1,a_1),op_2,a_2),op_3,a_3),op_n,a_n)mod109+7,\bigg(\ldots\Big(\big((a\_0 \\,\operatorname{op}\_1\\, a\_1) \\,\operatorname{op}\_2\\, a\_2\big) \\,\operatorname{op}\_3\\, a\_3\Big) \ldots \\,\operatorname{op}\_n\\, a\_n\bigg)\quad \bmod 10^9+7, where the nn operators op_1,,op_2,,,,op_n\operatorname{op}\_1,\\, \operatorname{op}\_2,\\, \ldots,\\, \operatorname{op}\_n are either ++ or ×\times. For example when given input (a_0,a_1,a_2)=(1,1,2)(a\_0,a\_1,a\_2) = (1,1,2) with hidden operators (op_1,op_2)=(+,×)(\operatorname{op}\_1,\operatorname{op}\_2)=(+,\times), then the function returns ((1+1)×2)=4mod109+7((1+1)\times2)=4 \bmod 10^9+7.

You can still execute the function a few times on some input and read the returned value. Use this to recover the operators.