complete 1001.cpp