complete 1003.cpp