I would like to share much valuable lesson I learnt today in Div2- 986 contest. I wasn't able to Solve B, and that costs me not solving C and D.
For anyone, not being able to solve an easier problem, is more frustrating than not being able to solve hard problem.
Chronology:
1) Mistakes 2 wrong submissions in B:
Since 10 ^ 18 * 10 ^ 18 was too large, I wrote of writing code in c++, and convert it to python. Which Got TLE . First wrong submission started panic mode.
Then, I started to find O(1) solution for Problem B, and missed edge cases. Wasn't able to solve B for first 50 minutes of the contest and I couldn't control emotionally.
2) Read Problem C, found it very easy. Submitted, which failed on C
I submitted this C, during the contest. just by changing one of <=
condition to <
gave me AC. I would have easily debugged this, if I would have been calm.
3) I misread D, implemented wrong, couldn't even pass pretest-1 As I have mentioned in this comment, I had missed one crucial detail the the problem D.
After the contest, I solved B,C,D all together. I figured out, that C and D I was quite close to solve. Even if I had solved C and D, and left B unsolved during the contest, I would have been satisfied with my performance.