main.cpp: Implement algo design