Fix all input test bugs and generate answer files