Math Puzzle (Hard)