diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -12,7 +12,7 @@
     for i in range(1, k + 1):
         pre[i] = pre[i - 1]
         if i % 2 == 0:
-            pre[i] += a[i] - a[i - 1]
+            pre[i] += a[i - 1] - a[i - 2]
 
     for i in range(k - 2, -1, -1):
         after[i] = after[i + 1]
