solved 1a
solved 1c
solved 1f
1g solution candidate (made on the train, needs testing)
solved 1g with a second implementation version, sub-second execution time for [k d] = [12 2]