diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -6,7 +6,7 @@
 ans = 10**18
 
 for i in range(n):
-    r = n
+    r = n + 1
     l = -1
     while r - l > 1:
         v = (r + l) // 2
