Stretch goal: optimize problems to run in less than 1 second.
More realistic goal: optimize problems to run in less than 1 minute.
Problem 1: 6118 μs (866436, 276650720)
Problem 2: 6497 μs (542, 360)
Problem 3: 7776 μs (232, 3952291680)
Problem 4: 9161 μs (219, 127)
Problem 5: 4277 μs (991, 534)
Problem 6: 6594 μs (6726, 3316)
Problem 7: 21934 μs (205, 80902)
Problem 8: 9248 μs (1217, 501)
Problem 9: 2463 μs (22477624, 2980044)
-------------------
Total: 74068 μs