#CCBCHBAHAI0000140. Tổng mảng rất lớn (A Very Big Sum)
Tổng mảng rất lớn (A Very Big Sum)
A Very Big Sum
Source: HackerRank
Version: Phuoc Hung OJ Extended
Problem Statement
Given an array of non-negative integers, some values can be large enough that their total exceeds the signed 32-bit integer range.
Compute
and print the exact value of .
Input
- The first line contains .
- The second line contains integers .
Output
Print one integer: the sum .
Subtasks
Subtask 1 (100 points): and . The total always fits in signed 64-bit long long.
Examples
Input
5
1000000001 1000000002 1000000003 1000000004 1000000005
Output
5000000015
Explanation
The five values sum to . This is larger than , so a type wider than signed 32-bit int is required.