CODEVS 1220 (easy dp)