Rosetta Problems

How can I satisfy thee? Let me count the ways...

https://onlinejudge.u-aizu.ac.jp/problems/1155