Toggle navigation
YouTube
Facebook
Telegram
english
english
українська
Algotester 4.3
Build 501
2024-12-30
Log In
Contact Us
College
Sponsors
Donate
Sources
Python 3
n = int(input()) a = [int(x) for x in input().split(' ')] a += a s = 0 m = n // 2 for i in range(m): s += a[i] res = s for i in range(m, n*2): s += a[i] s -= a[i-m] res = min(res, s) print(res)