← All problemsSign in

Age Calculator

CodeChefRating 1724Open on judge ↗

Chef's planet is called Javad. A year on Javad has $N$ months numbered $1$ through $N$. For each valid $i$, the $i$-th month has $a_i$ days numbered $1$ through $a_i$. On Javad, years that are divisible by $4$ are leap years - the last month of each leap year is one day longer (it has $a_N + 1$ days). You are given Chef's birth date and the current date. Find the age of Chef in days, i.e. t

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start