Rosetta Problems

阿弥陀籤(あみだくじ)

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