Rosetta Problems

Free Contest 37 - RATIONAL2

https://oj.vnoi.info/problem/fc037_rational2