D-backs use long ball to get to Samardzija, Giants