Another failure case is 144491 After uncommenting your line print("After operation a,b",a,b) I see
After operation a,b 144440 51 After operation a,b 144389 102 After operation a,b 143888 603 After operation a,b 138887 5604 After operation a,b -361114 505605 Case #1: -361114 505605 -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/ca34e74c-9249-42f8-8679-bb59427d47a6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.