greedy.cpp B board