Calculate input size for various algorithms and time constraints.

Chapter 1, problem 1.
Include solutions to exercises from Chapter 1.
Fix typos and general improvements to the exercises.