Link đề bài: https://drive.google.com/open?id=1fSkuDgi37GBE4QoGUz59GuKbypy3cYsa
Subtask 1: 1<=n<=10^6