Rating:

The problem is just solving a straightforward knapsack problem. You may ignore most of the code.

Original writeup (https://www.nevivur.net/writeups/2019/04/tjctf-2019/#is-this-the-real-life).