Improved deterministic algorithms for weighted matching and packing problems