Giving wrong answer

line 5 : if I change int min to ll min

and in line 18 : int mid to ll mid
then solution gets accepted otherwise not.

why do we need long long here ? as mid is well within the range of int.

code: https://ide.codingblocks.com/s/239106

@prateek_5 when you are multiplying two no in check function thats when its exceeding int range.
i hope your doubt is resolved if yes dont forget to mark it as resolved :smiley:

product is being stored in β€˜z2’ which is long long . what has product to to do with a rather fixed integer value of β€˜min’ ?

@prateek_5 actually the test cases contain input greater than 10e9 thats why like test case 6 is
264817710 998097158 41257415 6 ans 62 but code with int gives garbage value.

1 Like