Hey I have used 2 segment trees for implementation. But still, I am getting wrong answer. Can’t figure out why. Could anyone please help me out? Solution :

It is because of printing error. Using double causes large values to be printed in scientific notation, and CodeChef doesn’t accept that format. Rectified it with the use of System.out.printf().