Amplitude Hackathon '23 Practice Problem 1 - Gigatron EPS Modulo 998244353

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

Kurt's favorite prime number is 998244353. Over the course of N seconds where he knows how many events Gigatron processed each second, he wants to know the total number of events Gigatron processed, modulo 998244353.

Constraints

1 \le N \le 10^6

0 \le a_i \le 10^9

Input Specification

The first line of input contains a single positive integer N.

The second line contains N nonnegative integers, a_i, representing the number of events Gigatron processed during second i.

Output Specification

Let T be the total number of events Gigatron processed over the N seconds. Compute the remainder when T is divided by 998244353.

Sample Input

3
1000000000 1000000000 994733059

Sample Output

0

Sample Explanation

We can see that Gigatron processed 2994733059 events. Note that 2994733059 = 3 \times 998244353, so the remainder when 2994733059 is divided by 998244353 is zero.


Comments

There are no comments at the moment.