EU and Korea agree terms