#include #include #include using namespace std; int main() { int shelfWidth; while (cin >> shelfWidth && shelfWidth != -1) { list bookshelf; // IDs for the books currently on the shelf, from left to right int total(0); // cumulative width of all books on the shelf vector width(101, 0); // width for known books, indexed by book ID vector::iterator> locate(101, bookshelf.end()); // positions of books on the shelf, index by ID // run the simulation and output the results... } }