FIBONACCI REVISITED
CodeChefOpen on judge ↗
chef has defined his new fibonacci series.After some terms add operation causes data overflow error so he don't like that series. In his series he used $M$ terms. Here is his new defination: if $M \leq N$ then $fib(N)=fib(N-1) \oplus fib(N-2) \oplus ...... \oplus fib(N-(M-1)) \oplus fib(N-M)$ where $N ,M$ and first $M$ fibonacci number is given. Help chef to find $fib(N)$ value. ###Input:
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