diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -72,7 +72,7 @@
             blockY = max(blockY, -blockY)
             if blockX > blockY:
                 blockX, blockY = blockY, blockX
-            dist = 2 * blockX + 3 * (blockY - blockX) + dist0 + dist1
+            dist = 2 * blockX + 3 * (blockY - blockX) // 2 + dist0 + dist1
             if dist < res:
                 res = dist
 
