Rosetta Problems

ab ≒ c Hard

https://hoj.hamako-ths.ed.jp/onlinejudge/problems/843