Array Sum

4

1 votes
Easy
Problem

You are given an integer array and you have to find the sum of the elements of the array and find the remainder when the sum is divided by the largest number of the array.

INPUT :

First line contains the number of elements 'N' of the array.

Next line contains N space separated integers (elements of the array).

Output : 

Print the remainder when sum is divided by the maximum element.

CONSTRAINTS :

0 < n <= 100

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Here 1st line contains number of elements in the array i.e. 5

Elements are 1 2 3 4 5

sum = 1+2+3+4+5=15

remainder = 15%5=0

So output is 0

Editor Image

?