E. Fire http://codeforces.com/problemset/problem/864/E Polycarp is in really serious trouble — his house is on fire! It's time to save the most valuable items. Polycarp estimated that it would take ti seconds to save i-th item. In addition, for each…
E. Fire time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp is in really serious trouble — his house is on fire! It's time to save the most valuable items. Polycarp estimated that it…