Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

Why is 1 subtracted?

Revision en1, by CandidFlakes, 2023-07-25 13:43:46

I was trying to solve this question. After trying enough i finally read the tutorial and the solution code here. I almost got everything in the editorial but I am unable to understand why are we subtracting 1 in the solution code? ans += (i — 1) / (2 * a[0] — 1);

Tags lower bound, upper_bound

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English CandidFlakes 2023-07-26 20:28:47 112 Added some more detail to make my doubt clearer. (published)
en2 English CandidFlakes 2023-07-26 20:23:51 836 Tiny change: 'this code #include <' -> 'this code \n\n#include <' (saved to drafts)
en1 English CandidFlakes 2023-07-25 13:43:46 463 Initial revision (published)