Can you clarify the need of using double in Java to solve it?
@harshil21 code link : CodeChef: Practical coding for everyone
checked all the cases mentioned in the thread working fine for all
Please share the missing case
Just work on these, you’re very close.
3
19377283 19368100 30890 31436
23962289 7250321 22993 23560
11014 21047686 21058127 21061591
Answers:
30895
23473
21060486
When i brute force all the bits , the value of product is exceeding 2^64 thus resulting in a long overflow, that’s y
am able to pass subtask 1 and 2 but getting WA and TLE for subtask 3 alone .
@harshil21
Here is my solution link
https://www.codechef.com/viewsolution/33177144
2
2369383 11351335 17317 26860
20186496 20195266 20218112 20226640
Now, try generating some random cases on your own and check with the brute force solution to check for answers.
No, your code is missing some other cases, the error is not of overflow.
Try generating random cases and compare with brute force solution.
Yes @harshil21, i found that mistake and rectified ,now all the testcases mentioned in the above comments are getting passed still am getting a WA and TLE in subtask 3 ![]()
Here is my solution link ,
CodeChef: Practical coding for everyone @harshil21
Even these cases are passed … 
But i coded in java
@redoc_007 all the test cases mentioned above got passed still am getting WA and TLE idk why 
Use a random test case generator as mentioned in the code. Create your own…idk java.
will try thanks.
Nice question which had my week time in 10 days of long challenge and also really nice logic. 
Try the cases near the limits as discussed above and hopefully you’ll find your mistake.
Tried everything mentioned.
I am surprised. Your code is passing every test case as tested by random test case generator. I’ve tested your code for many cases. It passes everything.