転載だけどQTの解答
https://docs.google.com/spreadsheets/u/0/d/1zRro223lq5im95laAW6221T7-q1X84FoyK5BYgPAmjI/htmlview