Update magic_pairs.cpp