Best Editorials for the problems of Codechef and Codeforces!(beginners and intermediates)

I and my TEAM have taken an initiative to write editorials which are pretty easy to understand even for beginners.I write them in the easiest manner possible and explain the solution from scratch so that even a beginner can understand thoroughly!

I even provide extra links at the end of my editorial(s)/solution(s) to learn the concept(S) involved.

And I even try to explain things clearly in detail with images!
Feedback will be welcomed!:slight_smile: :smiley:

I write editorials in my Quora Blog:-


I see no links.

they are now there!

To check whether “‘x’ and ‘y’ are 2 terms of an Arithmetic Progression” you need only check if (x-y) is divisible by d.

THATs just the same thing :D, but further in the problem,there is a need to use that formula, especially when we have to calculate, how many turn(s) will it take to reach the end/starting page.And, I guess formula gives the ‘real’ feel. Though, thanks for pointing out :slight_smile:
Btw,your suggestion is great, it helps us in avoiding the use of ‘double’ :slight_smile:

Double should be avoided as much as you can, else you’ll pay a big deal at least in Codeforces contests.

Also, you dont even need to calculate turns. Just output yes. The editorial should, in my opinion, further discuss why answer is always yes and what this all means in a relative perspective. But its still a good attempt.

Thanks for the feedback! :slight_smile:

But, I did not get you.

You said–>‘answer is always one’.

The answer is not always one!! It can be any positive integer!!! AND WE HAVE
TO OUTPUT ‘-1’ if answer does not exist.
Thanks again, we will improve :slight_smile:

@vijju123 is talking about Chef and Difficult Contests’s editorial , I think

Yeah, I thought he is calculating turns needed in “Chef and Difficult Contest”.

And even then, the ‘double’ thing was relevant at both the places :smiley: :slight_smile: