I've tried to solve this using sieve and prime factorization but I got TLE for some cases. ↵
Here is the CSES problem:)↵
(https://cses.fi/problemset/task/1713/)↵
↵
[Here is my solution](https://ideone.com/EiLUs2))↵
↵
I need a more efficient approach.
Here is the CSES problem:)↵
(https://cses.fi/problemset/task/1713/)↵
↵
[Here is my solution](https://ideone.com/EiLUs2))↵
↵
I need a more efficient approach.