Samardzija, Cubs beat Nationals 4-3