Junior_chef
CodeChefOpen on judge ↗
Chef's kid, Junior chef loves playing with different series. Chef, impressed by his son's curiosity, gifts him a special series S on his birthday S=1,2,-2,3,-3,3,4,-4,4,-4,............. Now chef, eager to check the intelligence of his son, gives him q queries to solve. Each query consists of two positions a and b, and Junior_chef is required to calculate the sum of all integers from a to b. Inp
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start