Update SRM 578.cpp