New Zealand PM announces resignation