Here is the algorithm: algorithm

© Petri Keckman 2024.