#P1797. E - Mod i

E - Mod i

题目描述

PDF

输入格式

As shown in the pdf.

输出格式

As shown in the pdf.

样例

4 
1 2 3 4 

3 

5 
8 6 3 3 3 

5 

10 
791754273866483 706434917156797 714489398264550 918142301070506 559125109706263 694445720452148 648739025948445 869006293795825 718343486637033 934236559762733 

15 

提示

AtCoder Beginner Contest 207 by 杨鑫