Masala #0873
Qism massiv summasi
Sizga n ta elementdan tashkil topgan A massiv berilgan. Sizning vazifangiz shu massivdagi elementlardan foydalanib massiv ichidan summasi eng katta bo'lgan qism massiv summasini topishdir.
Kirish faylining dastlabki satrida bitta butun son N soni kiritiladi \((1 \leq N \leq 10^5)\) Keyingi qatorda N ta butun son A massiv elementlari kiritiladi \((-10^9 \leq A[i] \leq 10^9, 0 \leq i < N)\)
Chiqish faylida yagona butun son - masala javobini chop eting
# | input.txt | output.txt |
---|---|---|
1 |
10 -9 8 5 -7 8 -1 5 6 -8 -9 |
24 |
2 |
8 1 2 3 -9 8 -7 5 4 |
10 |
2-testda 8 + (-7) + 5 + 4 = 10