Computing Large Fibonacci Numbers Modulo 10000 Using Matrix Exponentiation
Problem Statement
Given a non-negative integer n where 0 ≤ n ≤ 2×10^9, compute the n-th term of the Fibonacci sequence modulo 10000. The sequence is defined as F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. The input consists of multiple test cases, each containing a single integer n. Processing terminates when n = -1.
Algorithmic ...
Posted on Thu, 13 Aug 2026 16:29:55 +0000 by neex1233