F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Being a Predictor

Time Limit: 30000/15000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others)
Total Submission(s): 391    Accepted Submission(s): 190


Problem Description
Let A(x) = Sigma(Ai * x^i) (0<=i<=N-1). Given A(1), A(2),..., A(N), You are asked to calculate A(N+1) mod 112233.
It is guaranteed that A(1), A(2), бн, A(N), A(N+1) are all integers.
 

Input
There are multiple test cases, ended with an EOF.
For each case:
Line 1 contains a positive integer N (N <= 10^6).
Line 2 to Line N+1: each contains a non-negative integer less than 65536. The integer in Line i is A(i-1).
 

Output
For each case, print A(N+1) mod 112233 in a single line.
 

Sample Input
1 18605 5 19543 19998 12266 27854 2103
 

Sample Output
18605 110887
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 08:21:19, Gzip enabled