@bradley It isn’t a bug, but the output you got is because you don’t give custom input and the local variables in the program got initialized to random or garbage values and as they may be large enough say of order of 10$^9$, which results in TLE. As per C99, if an object that has automatic storage duration is not initialized explicitly, its value is indeterminate.